Job 3 (a)

1. Create / guanli directory, create two directories. Journal Zonghe and (a command) at / guanli
mkdir -pv / guanli / Zonghe && mkdir -pv / guanli /. Journal
2, group account added zonghe, caiwu, jishu, GID No. It is set to 2001,2002,2003
groupadd -g 2001 Zonghe groupadd -g 2002 caiwu groupadd -g 2003. Journal
3, create jerry, kylin, tsengia, obama user, which kylin user account failure in December 2020 after 30
useradd - 2020-12-30 Kylin the useradd Jerry the useradd E tsengia the useradd Obama
. 4, adding jerry, kylin, tsengia, obama other users into groups Zonghe
the gpasswd -M jerry, kylin, tsengia, obama Zonghe
. 5, creating handy, cucci user, wherein Shell cucci login account is set to "/ sbin / nologin"
the useradd the useradd -s / sbin / nologin / cucci Handy
. 6, adding handy, cucci other user group. Journal into
the gpasswd -M handy, cucci. Journal
. 7, all the above-mentioned users are required to be added to the group guanli
-M jerry the gpasswd guanil the groupadd, Kylin, tsengia, obama, Handy, Guanli [cucci
. 8, the user obama Zonghe group deletion in
the gpasswd -d obama Zonghe
. 9, jerry user password is set to "123456" (using conventional methods)
   is cucci set a password for the user "redhat" (use --stdin method) 
passwd jerry 123456 echo "RedHat" | passwd - stdin CUCCI    
10, the jerry user to lock and view the locked state
passwd passwd -S the -l jerry jerry   
11, two open xshell a window through (who or w) command to check the connection status, and wherein via killing a fuser
fuser -k / dev / PTS / 2
12 is, the user view cucci, those belonging to the group, and view its details
ID cucci
UID = 1006 (cucci) gid = 1006 ( cucci) 1006 group = (CUCCI), 2003 (. Journal), 2004 (guanli)
groups CUCCI
CUCCI: CUCCI. Journal guanli
13, manually create accounts student
14, set permissions and ownership:
   / guanli directory is a group set guanli
   is a group / guanli / zonghe directory to Zonghe
   / guanli / directory is a group jishu set jishu
   set up three directories are prohibited other user access permissions
chown : Guanli [/ Guanli [
chown: Zonghe / Guanli [/ Zonghe
chown:. Journal / Guanli [/. Journal
the chmod -R & lt Ar / Guanli [
LL / Guanli [
15, establishing a common directory / ceshi
   allow all users within the skill set of read, write, execute the file
   prohibiting other users read, write, execute
mkdir / ceshi
chown:. Journal / ceshi
chmod 770 / ceshi
LL -d / ceshi
16, jerry clear user password
passwd -d jerry
17, locking the user's password and view the status cucci
passwd cucci the -l
passwd -S CUCCI
18, obama modify the user's UID is 8888
the usermod -u 8888 obama
CAT / etc / passwd | grep "obama"
obama: the X-: 8888: 1007 :: / Home / obama: / bin / bash
19, kylin modify the user's password by using the passwd command a maximum period of 60 days
passwd -x 60 kylin
adjust the user's password aging data kylin.
passwd: successful operation
[root @ localhost ~] # CAT / etc / Shadow | grep "Kylin"
Kylin: !!: 18107: 0: 60: 7 :: 18626:
20, view the user handy information id groups finger commands
id Handy
UID = 1008 (Handy) GID = 1008 (Handy) group = 1008 (Handy), 2003 (. Journal), 2006 (Guanli [)
[the root @ localhost ~] # groups Handy
Handy: Handy. Journal Guanli [
[the root @ localhost ~] # Handy finger
the Login: Handy the Name:
Directory: / Home / Handy Shell: / bin / bash
Never logged in.
No mail.
No Plan.
 
 

Guess you like

Origin www.cnblogs.com/smmm123/p/11280294.html