Practical Exercise: 3 (User, Group, Permission)

Red Hat Linux Essentials File-System, Directory, Files, User, Group and Permissions
30 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€46.64
List Price:  €65.30
You save:  €18.66
£39.89
List Price:  £55.85
You save:  £15.96
CA$68.25
List Price:  CA$95.55
You save:  CA$27.30
A$76.15
List Price:  A$106.62
You save:  A$30.46
S$67.98
List Price:  S$95.18
You save:  S$27.19
HK$391.26
List Price:  HK$547.80
You save:  HK$156.53
CHF 45.56
List Price:  CHF 63.79
You save:  CHF 18.23
NOK kr549.77
List Price:  NOK kr769.72
You save:  NOK kr219.95
DKK kr347.88
List Price:  DKK kr487.07
You save:  DKK kr139.18
NZ$83.68
List Price:  NZ$117.16
You save:  NZ$33.47
د.إ183.60
List Price:  د.إ257.06
You save:  د.إ73.45
৳5,493.12
List Price:  ৳7,690.80
You save:  ৳2,197.68
₹4,172.34
List Price:  ₹5,841.61
You save:  ₹1,669.27
RM238.42
List Price:  RM333.81
You save:  RM95.39
₦66,243.24
List Price:  ₦92,745.84
You save:  ₦26,502.60
₨13,934.07
List Price:  ₨19,508.81
You save:  ₨5,574.74
฿1,850.39
List Price:  ฿2,590.69
You save:  ฿740.30
₺1,617.84
List Price:  ₺2,265.11
You save:  ₺647.26
B$255.79
List Price:  B$358.13
You save:  B$102.34
R936.97
List Price:  R1,311.83
You save:  R374.86
Лв91.24
List Price:  Лв127.74
You save:  Лв36.50
₩68,826.74
List Price:  ₩96,362.95
You save:  ₩27,536.20
₪188.13
List Price:  ₪263.40
You save:  ₪75.26
₱2,884.49
List Price:  ₱4,038.52
You save:  ₱1,154.02
¥7,792.89
List Price:  ¥10,910.67
You save:  ¥3,117.78
MX$856.20
List Price:  MX$1,198.75
You save:  MX$342.54
QR182.49
List Price:  QR255.51
You save:  QR73.01
P688.94
List Price:  P964.58
You save:  P275.63
KSh6,748.65
List Price:  KSh9,448.65
You save:  KSh2,700
E£2,392.02
List Price:  E£3,349.02
You save:  E£957
ብር2,872.52
List Price:  ብር4,021.76
You save:  ብር1,149.23
Kz41,694.65
List Price:  Kz58,375.85
You save:  Kz16,681.20
CLP$47,530.99
List Price:  CLP$66,547.19
You save:  CLP$19,016.20
CN¥362.03
List Price:  CN¥506.87
You save:  CN¥144.84
RD$2,934.22
List Price:  RD$4,108.14
You save:  RD$1,173.92
DA6,720.10
List Price:  DA9,408.68
You save:  DA2,688.58
FJ$112.74
List Price:  FJ$157.85
You save:  FJ$45.10
Q389.28
List Price:  Q545.03
You save:  Q155.74
GY$10,471.17
List Price:  GY$14,660.48
You save:  GY$4,189.30
ISK kr7,010.59
List Price:  ISK kr9,815.39
You save:  ISK kr2,804.80
DH505.57
List Price:  DH707.84
You save:  DH202.26
L884.78
List Price:  L1,238.76
You save:  L353.98
ден2,871.74
List Price:  ден4,020.67
You save:  ден1,148.92
MOP$403.59
List Price:  MOP$565.05
You save:  MOP$161.46
N$944.34
List Price:  N$1,322.15
You save:  N$377.81
C$1,841.99
List Price:  C$2,578.94
You save:  C$736.94
रु6,672.93
List Price:  रु9,342.64
You save:  रु2,669.70
S/188.02
List Price:  S/263.24
You save:  S/75.22
K193.20
List Price:  K270.50
You save:  K77.29
SAR187.49
List Price:  SAR262.50
You save:  SAR75.01
ZK1,326.34
List Price:  ZK1,856.98
You save:  ZK530.64
L232.07
List Price:  L324.92
You save:  L92.85
Kč1,174
List Price:  Kč1,643.69
You save:  Kč469.69
Ft18,283.73
List Price:  Ft25,598.69
You save:  Ft7,314.95
SEK kr545.79
List Price:  SEK kr764.15
You save:  SEK kr218.36
ARS$43,729
List Price:  ARS$61,224.11
You save:  ARS$17,495.10
Bs347.11
List Price:  Bs485.98
You save:  Bs138.87
COP$197,925.35
List Price:  COP$277,111.33
You save:  COP$79,185.97
₡25,432.40
List Price:  ₡35,607.40
You save:  ₡10,174.99
L1,235.97
List Price:  L1,730.46
You save:  L494.48
₲372,674.68
List Price:  ₲521,774.38
You save:  ₲149,099.69
$U1,931.55
List Price:  $U2,704.33
You save:  $U772.77
zł201.70
List Price:  zł282.40
You save:  zł80.69
Already have an account? Log In

Transcript

Hey friends and welcome back. Now in this series we are going to discuss another new topic that is permissions. Actually, there are two types of permissions, file permissions and directory permissions in file permissions that you can restrict access for the files users access for the files groups and the access for everyone else. And in directory permissions is same for that free and for this therefore, scenarios like for symbols to be exact, R, R for read w for write and x for execute and dash for no permissions. So let's start with r1. That our what is our actually our means read which I told you before is able To read a file or list are directories contained, who can create lists can modify or remove anything can be done when this permission is right.

And for execute, it means a permission to execute a program or change into a directory and do a long listing of the directory. And for dex it means no permissions, which we are going to write when there is no option either for our either for W or x. So let's start. Let me show you something before starting. Firstly open terminals and terminals. We're going to write LS minus L. As you can see here, this left side something else WX are access dash.

So what is this all about? Actually, this permissions is divided into three categories. first condition category is, same user is the current user. There's three lines, okay three, okay. Then from here to here, this permissions is for groups. And from here to there here.

This is for others. Okay, I hope you understand what I want to say this is the name of foil. Let's create a file and set up permissions using two methods of setting permissions. One is symbolic method and other one is numerical method. The one which I like the most is no macro method. We'll tell you why later on so let's start with some bullet matter okay again firstly we have to create a file to create a file then write A, B C D that's it next section, which means it is a binary file.

Let me show you versus current petition ABCD here is ABCD. And till now, without doing nothing, the permissions for same user is that he cannot read as well as right but can execute. And this version is same for groups also, but the others users can just only can read it. Okay, mistake is able to see that clearly there is a file ABC exist. Okay, now I'm going to change this permissions. Okay?

So for changing the permission, that thing which I'm going to write, and then the command which I'm going to use is ch mod with the teens more. See, ah that's it. And as I told you before, I mean St. W means write x means execute and dash no permissions that keep in mind okay. And one more things which I wanted to say, add in this symbols, you means users, g means groups and all means others. I hope you understand. Again, I want to repeat okay.

Humans users, g means groups. All means others. Are means read. W means write. Then comes x Miss, execute and dash Miss no permission. Okay, so let's start with leads I first going to write these more than you have to use to change permissions and offer writing this you have to write one by one or specifically you, you means this current user plus is used that we are allowing that permission.

In our case, u plus W, it means that I'm granting this current user to right, okay, and comma, then write g, o, here g means group and omens others, okay? And I just want to remove the right permission from them. So for ads permissions you can use plus symbol and for removing the permissions you have to use negative minus and then W and after all this you have to write the name of file, which we are creating right now A B C D again I am going to run that forum on that command ABCD one previously let me show you rW rW R. Now, what I had met Now, now, I had given a nothing changed here of current user, but you can see clearly Firstly, there was a write permission to this group. But now, I denied this version from group as you can see the blue is not there, there is no permission dashes there Similar now, I want all of them all of them have what have all permissions to be use graphical symbolic Mateo ch mo d u GO plus r a blue x and the name of a BCD accident.

Now, you can easily find out that the file which I have created this ABCD one having all permissions, rW x rW x in our Ws, this for current user, this for groups and this for others. You can either do it By using pneumatic monitor, so, before performing pneumatic matter, just remove all the permission from them. As you can see, this old thing is convert into dash dash. Simple, right? This means if this had nothing, no permissions. Okay, now I'm going to use our new Mac thing no matter which I love the most, because let me tell you after writing this command, CH mod, then comes 777 says my lucky number and the name of your file A, B, C, D. Okay?

Now see the magic. All this dash one converts into a complete formula To all categories, users, groups or groups. So, what is seven seven here? actually four means for four to read that interest in like 444 read to four right and one for execute note that for for read twofold right and confer execute. Now some this three numbers four plus two plus one that means seven. If the, if I had written seven, this means the this same user having all the permissions similarly for groups and similar for others in case I just want only Read and Write permission not execute permission for that you're correct six because four plus three equal to six, we detected that plus one that means execute from here to for that 666.

Let me show you how it will look like 6666 I don't know. I don't know the execute bar permission is removed from each categories. Now comes I only found read. For that I have to write just 444 and see the magic only are our eyes there and I just want only execute or that 111 Hope you understand what I mean to say to set the positions or sorry to set the permissions you can use either symbolic mentor, which is also great. And you can also use numeric matter for domain manager you have to keep in mind that 443 to four years right and one for you execute operations, store permissions and in submit lick matter are means read w means what right x means execute dash with no permission This is all and you for users, g4 groups over others, plus for adding permissions to them and minus for trim decline the permission from them.

Okay, so this is all about file permissions which I had shown you know, the other thing which I'm going to discuss in this series, On in this part of space only the command line shortcuts is. In this I'm going to discuss a file called Ling go fabulous uses of TAB key, and many other things that start. So, let's start with five Goblin. While Goblin actually the first starting Goblin, I want to tell the court is cuddling actually drop clothing, dropping his clothing. clothing is a wild card expansion. Just like regular expressions in all programming languages, Python programming language.

In regular expressions, there are some symbols like stars, then dot, many others like that. Here we're going to use their symbols on So let's start. Suppose I don't know there's only one text file, let me create at least three txt file to understand this example variable, m e, x d. Now, you can see, there are three files, and not three, four, actually four is there, ABC, A, B, C, D, F and G Ha. Now I'm going to use globing by Google just write an asterick dot d x d not here, extract means for all for all means that the file with extension GST will be selected as I'm using RM function RM comma command, which means it will remove that file. Let me show you just press key actually the move represented by ABC dot txt you can see that ABC only remove that produces What happened?

Yeah, nothing is affected here because the permission was set. I can do nothing. So to delete it, we have to change the permission, I'm not going to change again the permissions I do look forward. Now as you can see that other than this fine like ABC dot txt t f dot DST gh eight dot txt is removed from using this expressions as to dot txt. Actually this corner also deleted but this permission is set. That's fair.

And there is nothing happened to this file. So don't worry about that. Look at this expressions. Yeah, a strict means for all means this one, this one, this one and this one. Okay. Other than a strict there's a symbol question mark.

Now you're thinking this, what is the uses of kosher muck that we create File gha again not anxious right? odd him again I want to remove this file and I don't know the starting name of a file. Okay? I'm just write question mark and I know that the file ends with a little dot t x t because I'm targeting that file only. Julie g h i wanted to do Cool See? Yeah.

Actually what is going to happen here is that it is selecting this think means I used here it is considering there is only one lecture here like pictures and videos being i vi, there's why the folders is selected, not this file is selected. Okay. Oh, I hope you understand what I'm going to see. Okay, other than that, there's Another, we will bring math symbols, like you can write a number 09. And in here, or either you can write ABC to simplify your expressions. Nine, I'm going to show you another thing.

Very interesting thing. Suppose I have a box and then press tab. What is it is written automatically this autocomplete features is done by using or pressing our TAB key. Okay. show you another touch, okay. And again, I'm going to press the step touch is auto completed.

This autocomplete feature is only 10 by just pressing it Back key interview for the most interesting thing, yeah, that's right equal here. Comma. Hi. My name is Brandon. That's my name. And presenter.

Actually I created a file. Don't bother about it just showed this equal actually equal means to print and as you can see on screen is printed strings which are written under this. colons Hi, my name is bronzer and it is written to string, okay? Other than that, if you want to Let me show eco. Why. Colliver SS one comma three comma five as you can see here when I had to use this LS function, they were no one file 515355 But now, when I will take this thing you can see here Oh yeah, file one file 355 these are actually do right 515355 you can shorthand your string portion just using curly braces.

Some more trees which I want to discuss here is Like, if you want to copy something inside your terminal, just press Ctrl plus Sif and then plus C and to paste it Ctrl Shift v. Actually there is no command like that 5135 there's a string command not found. Now, if you want to have another tab inside your terminal Ctrl Shift T and the tab is open. Now if you want to switch from, you know this tab with this tab, again, return for there, just use Ctrl Shift V to paste on page based on patient based on to switch your tabs inside your terminals, okay? If you don't press Ctrl and Shift and then pager and just pressing page of BS down it will just show you history of your phone lines. Yeah, one more thing. Another important command that is alias is in my previous video I had discussed this feature.

Let me show you how it works. P is equal to Now I had given this gal or nickname that his peers. Now whenever I would call three years It works like calendar and you can use this calendar or they can use because it was the same I had just Given a nickname for girl or a nickname or you can say another name a simple name okay. This is not basically for short commands like which I had to use the L the commands like like that see a small one one ABCD This is too big for that you can just try areas then yeah as it is string Don't forget to add this thing okay and then put a call and again inside this you have to write your command which you want to have a nickname or to have to became into alias So, this is all about I discuss permissions Firstly, it is good permission that some shortcut keys then discuss about areas, five low being, and many more things to switching one from here to here.

Other thing which I'm going to have is to create ourselves scripts. For that you have to open up, create a file using GG, it is very easy to use a text engine. I had already discuss about this right? example assets recon open a new file named example.sh. And you have to just right this first time You can call it a C bang, okay. Then for insert scripts for adding comment, you can use this hash function.

I just write equal Hello, everyone. Hello everyone. That's it and see if this file was it Actually I didn't put it the conditions here as well as far as not opening right now. Yeah. Now you can see the, the portion where at use hash that was considered as a comment Other than their thing which I had written on that first equal Hello everyone this is displaying here. Firstly, there was my permission, I put the on permissions here set by using 777 discuss you before and just use gatt function.

As you can see it shows all the stuffs which are inside your file named x.sh. Here sh is for your shell script. You can have your phone, you can have your Python. You can also have CSS CSS, z shell scripts. You can also have bash a lot of things. This is a simple example which I have shown is what shell scripts and since scripts you can write the commands like which you write directly on terminal, okay.

So, here it is, as you can see here equal mine Hi my name is bronchial, this is a type Can you can call it is simply a command, okay equals a command and it's just putting down the strings here. So, I had used this shell script to run this command. You can also add date inside it to print the date, etc. Let me so for this Now, it is also showing a date okay I hope you are no understand that what is sells scripts how you can use those scripts actually says script and they uses a system is that when you have to perform a theme task set of commands to be run on various numbers of systems. Suppose, if there is a lab containing a lot of systems 10 to five or 2030s systems and you have to perform five to six commands in our systems.

Then you will go and sit and write that five commands and data gain again you have to go second system and perform the same action this will take Long time, instead of writing that five to six commands, you can write in a shell script and run this all in your system without writing again and again. This will make our task easier, and it also saves our time. So this is the uses of sales reps. So, I hope you understand what is the uses of sales scripts. In my next video, I'm going to further discuss about another topics of origin. So for till now, keep practicing, keep learning, keep growing, and all the best

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.