7.30 jobs

1. Create / guanli directory, create two directories zonghe and jishu (a command) in / guanli
 
[root @ localhost ~] # mkdir -p / guanli / Zonghe | mkdir / guanli /. Journal
 
2, add a group account zonghe, caiwu, jishu, GID numbers are set to 2001, 2002
 
[root@localhost ~]# groupadd -g 2001 zonghe ;groupadd -g 2002 caiwu ; groupadd -g 2003 jishu
 
3. Create jerry, kylin, tsengia, obama user, which kylin user account expire after 30 December 2020
 
[root@localhost ~]# useradd jerry ;useradd -e 2020-12-30 kylin ;useradd tsengia ;useradd obama
 
4, adding jerry, kylin, tsengia, obama other users into groups zonghe
 
[root@localhost ~]# gpasswd -M jerry,kylin,tsengia,obama zonghe
 
5, create a handy, cucci users, cucci account login Shell is set to "/ sbin / nologin",
 
[root@localhost 桌面]# useradd handy ;useradd -s /sbin/nologin cucci
 
6, adding handy, cucci other users into groups jishu
 
[root@localhost ~]# gpasswd -M handy,cucci jishu
 
7, all users are required to be added to the aforementioned group within guanli
 
[root@localhost ~]# groupadd guanli | gpasswd -M jerry,kylin,tsengia,obama,handy,cucci guanli
 
8, obama users in zonghe group deleted
 
[root@localhost ~]# gpasswd -d obama zonghe
 
9, set a password for the user jerry is "123456" (using conventional methods)
 to set a password to "RedHat" (using the method --stdin) to users cucci
 
[root@localhost ~]# passwd jerry
[root@localhost ~]# echo 'redhat' | passwd  --stdin cucci

10, the jerry user to lock and view the locked state
 
[root@localhost ~]# passwd -l jerry
[root@localhost ~]# passwd -S jerry
 
11, two xshell open windows, by (who or w) command to check the connection status, and wherein through a fuser kill
 
[root@localhost ~]# fuser -k /dev/pts/2

12, see cucci users belong to those groups, and to view its details
 
[root@localhost ~]# groups cucci
[root@localhost ~]# finger cucci
 
13, manually create an account 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 rights
 
[the root @ localhost ~] # chown: Guanli [/ Guanli [/ | chown: Zonghe / Guanli [/ Zonghe / | chown: jiahu / Guanli [/. Journal /
[the root @ localhost ~] # the chmod -R & lt O = / Guanli [/
 
15, to establish a public directory / ceshi
allow all users in the technical group read, write, execute the file
 prohibit other users to read, write, execute
 
[root@localhost ~]# mkdir -m 770 /ceshi
[root@localhost ~]# chown :jiahu /ceshi/

16, clear the user password jerry
[root@localhost ~]# passwd -d jerry
 
17, locking the user's password and view the status cucci
 
[root@localhost ~]# passwd -l cucci
[root@localhost ~]# passwd -S cucci
 
18, the user's UID is modified obama 8888
 
[root@localhost ~]# usermod -u 8888 obama
 
19、通过passwd命令修改kylin用户的最长密码使用期限为60天
 
[root@localhost ~]# passwd -x 60 kylin
 
20、通过id groups finger等命令查看用户handy信息
 
[root@localhost ~]# id handy
[root@localhost ~]# groups handy
[root@localhost ~]# finger handy

Guess you like

Origin www.cnblogs.com/chenyingdong/p/11274490.html