Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet87/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   83   84   85   86   87   88   89   90   ...   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)

[
 59 
]
If you take a look at the 
/etc/group
 file again after adding a new group, you'll see 
that a new line was created in the file and a 
GID
 was chosen for you (the first one 
that hadn't been used yet). Removing a group is just as easy. Just issue the 
groupdel
 
command followed by the name of the group you wish to remove:
sudo groupdel admins
Next, we'll take a look at the 
usermod
 command, which will allow you to actually 
associate users with groups. The 
usermod
 command is more or less a Swiss Army 
knife; there are several things you can do with that command (adding a user to a 
group is just one of its abilities). If we wanted to add a user to our 
admins
 group, we 
would issue the following command:
sudo usermod -aG admins myuser
In that example, we're supplying the 
-a
 option, which means append, and 
immediately following that we're using 
-G,
 which means we would like to modify 
secondary group membership. I put the two options together with a single dash 
(
-aG
), but you could also issue them separately (
-a -G
) as well. The example I gave 
only adds the user to additional groups, it doesn't replace their primary group.
If you wanted to change a user's primary group, you would use the 
-g
 option instead 
(lowercase 
g
 instead of an uppercase 
G
 as we used earlier):
sudo usermod -g
Feel free to check out the man pages for the 
usermod
 command, to see all the nifty 
things it allows you to do with 
your users. You can peruse the man page for the 
usermod
 command with the following command:
man usermod
One additional example is changing a user's 
/home
 directory. Suppose that one of 
your users has undergone a name change, so you'd like to change their username, 
as well as moving their previous 
home
 directory (and their files) to a new one. The 
following commands will take care of that:
sudo usermod -d /home/jsmith jdoe -m 
sudo usermod -l jsmith jdoe 
Be careful not to miss the 
-a
 option here, as you will instead 
replace all current group memberships with the new one, which 
is usually not what you want. The 
-a
 option means append, or to 
add the existing list of group memberships for that user.


Managing Users and Permissions

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   83   84   85   86   87   88   89   90   ...   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