هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
الهدف
Set the defaults for new accounts, then create a small team with groups, password rules and one service account.
قبل أن تبدأ
- Work on server1 as root (
sudo -i). - This is a lab: you may use the password
passwordfor every user.
المهام
ضع علامة على المهمة عندما تنتهي منها. متصفحك فقط يتذكر ذلك.
- Make sure that every new user must change the password every 90 days and gets a file
WELCOME.txtin the home folder. - Create the group
saleswith GID 3000 and the groupaccount. - Create the users
annaandbob. Both are members ofsales;bobis also a member ofaccount. Set a password for both. - Create the user
carolwith the shell/sbin/nologinand no extra groups. Set a password. - The account of
bobmust expire on 31 December 2026. annamust choose a new password at her next login.- Lock the password of
carol. - Add
annato the groupaccountwithout removing her fromsales.
تحقّق من عملك
id anna; id bob; id carol
getent group sales account
chage -l bob | grep 'Account expires'
chage -l anna | head -2
passwd -S carol
ls /home/annaannaandbobare insalesandaccount;carolis only in her own group.saleshas GID 3000.bob: Account expires Dec 31, 2026.anna: "password must be changed".passwd -S carolshowsL(locked)./home/annahasWELCOME.txt.grep PASS_MAX_DAYS /etc/login.defsshows 90.
تلميحات
اعرض التلميحات
- Defaults for new users:
/etc/login.defsand/etc/skel/. Do this before you create the users. groupadd -gsets the GID.useradd -Gsets the extra groups.- Account expire date:
chage -Eorusermod -e. Force a new password:chage -d 0orpasswd -e. - Lock:
passwd -lorusermod -L. - Add a group and keep the others:
usermod -aG.
الحل
اعرض الحل
ملاحظاتي
لا توجد ملاحظات بعد.