Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet108/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   104   105   106   107   108   109   110   111   ...   482
Bog'liq
Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)

Changing permissions
So, now we 
understand how to read permissions on files and directories. That's 
great, but how do we alter them? As I mentioned earlier, the 
budget.txt
 file is 
readable by everyone (other). This is not good because the file is confidential. To 
change permissions on an object, we will use the 
chmod
 command. This command 
allows us to alter the permissions of files and directories in a few different ways.


Chapter 2
[
 73 
]
First, we can simply remove read access from the 
sue
 user's budget file by removing 
the read bit from the other field. We can do that with the following example:
chmod o-r budget.txt
If we are currently not in the directory where the file resides, we need to give a full 
path:
chmod o-r /home/sue/budget.txt
But either way, you probably get the idea. With this example, we're removing the 
r
 bit from other (
o-r
). If we wanted to add this bit instead, we would simply use 
+
 
instead of 
-
. Here are some additional examples of 
chmod
 in action:
• 
chmod u+rw
: The object gets 
rw
 added to the 
user
 column
• 
chmod g+r
: The owning group is given read access
• 
chmod o-rw
: Other is stripped of the 
rw
 bits
In addition, you can also use octal point values to manage and modify permissions. 
This is actually the most common method of altering permissions. I like to think 
of this as a scoring system. That's not what it is, but it makes it a lot easier to 
understand to think of each type of access as having its own value. Basically, each of 
the permission bits (
r

w
, and 
x
) has its own octal equivalent, as follows:
•  Read: 
4
•  Write: 
2
•  Execute: 
1
If you're using the 
chmod
 command against files other than those 
you own yourself, you'll need to use 
sudo



Managing Users and Permissions

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   104   105   106   107   108   109   110   111   ...   482




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish