Linux with Operating System Concepts



Download 5,65 Mb.
Pdf ko'rish
bet139/254
Sana22.07.2022
Hajmi5,65 Mb.
#840170
1   ...   135   136   137   138   139   140   141   142   ...   254
Bog'liq
Linux-with-Operating-System-Concepts-Fox-Richard-CRC-Press-2014

value
where 
value
is a three-digit number. 
This is not the actual permissions (e.g., 755) but instead a number that is subtracted from 
777 or 666.
As root, we might want to establish 644 for all files and 755 for all directories that we 
create. We obtain the umask value by subtracting 644 from 666 and 755 from 777. That is, 
777–755 
=
022 and 666–644 
=
022. So, our umask for root is 022. For an ordinary user, 
we might use the default permissions of 664 for files and 775 for directories. Since 777–
775 
=
002 and 666–664 
=
002, we use 002 for a user’s umask. For software, we will prob-
ably also use 022.
An examination of the /etc/profile file shows us the following instruction to set the 
umask:
if [ $UID –gt 199 ] && [ “‘id –gn‘” 
=
“‘id –un‘” ];
then umask 002
else
umask 022
fi
This instruction tests the user’s UID to see if it is greater than 199 and tests to see if the 
user’s ID name and group name match. The operation 
id –gn
provides the user’s group 
name and the operation 
id –un
provides the user’s username. We expect these two values 
to be equal for any normal user. If both the $UID is greater than 199 and the username 
and groupname are equal, then we are most likely dealing with a normal user as opposed 
to root or a software account. The normal user is given a umask value of 002 (to create 
permissions of 775 and 664). Root and software are given a umask value of 022 (to create 
permissions of 755 and 644).
In addition to the population of files and subdirectories of the new user’s home direc-
tory through /etc/skel, the creation of a new user causes the creation of an email “spool” 


376

Linux with Operating System Concepts
file. The spool file is a text file storing all of the received email messages (that have not been 
deleted). The location of the spool file can be specified through a default file called /etc/
login.defs. This file in fact stores a number of default items that are utilized by different 
Linux commands.
Table 9.6 lists many of the directives available that the system administrator can use to 
specify desired system defaults. Directives such as CREATE_HOME, UID_MIN, UID_
MAX, GID_MIN, and GID_MAX will impact the useradd instruction. Other entries 
impact other operations such as usermod, userdel, groupadd, groupmod, groupdel, login, 
passwd, and su. These defaults can also impact the contents of files such as /etc/passwd, 
/etc/group, /etc/shadow, and the mail spool files.
The system administrator can also place default restrictions on users in their shells. The 
ulimit
gives the system administrator the tool to enforce such limitations. This com-
mand, when used, does not impact currently running shells or anything launched via the 
GUI but will impact future shells.
TABLE 9.6 
Directives Available for /etc/login.defs File

Download 5,65 Mb.

Do'stlaringiz bilan baham:
1   ...   135   136   137   138   139   140   141   142   ...   254




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