north

1. Create / guanli directory, create two directories zonghe and jishu (a command) in / guanli
[root @ localhost ~] # mkdir -pv / guanli / zonghe -p / guanli / jishu
mkdir: directory has been created "/ guanli / Zonghe "
mkdir: you have created the directory" / guanli /. Journal "
[root @ localhost ~] # cd / guanli
[root @ localhost guanli] # LS
. Journal Zonghe
2, add a group account zonghe, caiwu, jishu, GID numbers are set to 2001,2002,2003
[root @ localhost guanli] # groupadd -g 2001 Zonghe; groupadd -g 2002 caiwu; groupadd -g 2003. Journal
3, create jerry, kylin, tsengia, obama user, which kylin user account in the year 202 012 failure after 30 months
[root @ localhost Guanli [] # the useradd Jerry; the useradd -e 2020-12-30 Kylin; the useradd tsengia; Obama the useradd
. 4, adding jerry, kylin, tsengia, obama zonghe into other user groups
[root @ localhost ~] # gpasswd -M jerry, kylin , tsengia, obama zongheuse
5, create a handy, cucci users, cucci account login Shell is set to "/ sbin / nologin"
[root @ localhost ~] # useradd handy
[root @ localhost ~] # useradd -s / sbin / nologin cucci
6, a handy , cucci added to the other user group. Journal
[root @ localhost ~] # gpasswd -M handy, cucci . Journal
. 7, all users are required to be added to the aforementioned group within guanli
[root @ localhost ~] # gpasswd -M handy, cucci , jerry, Kylin, Guanli [tsengia
. 8, in the user obama Zonghe group deletion
[root @ localhost ~] # -d obama Zonghe the gpasswd
. 9, the password set to "123456" (using conventional methods) to the user jerry
[root @ localhost ~ ] # passwd jerry
set cucci user password "redhat" (--stdin using method)
[root @ localhost ~] # echo 'RedHat' | --stdin the passwd cucci
10, the user locks jerry, and view the locked state
[root ~ @localhost] # Jerry the passwd -l
[the root @ localhost ~] # Jerry the passwd -S
11, two xshell open windows, by (who or w) command to check the connection status, and wherein through a fuser kill
[the root @ localhost ~] # WHO
the root: 2019-07-29 14:03 0 (: 0)
the root PTS / 0 2019-07-29 14:06 (: 0)
the root PTS / 2 2019-07-30 13:01 (192.168.1.1)
the root PTS / 2019-07-30 14:35. 3 (192.168.1.1)
[ ~ @ localhost the root] # the fuser -u / the root /
/ the root: 20940c (the root)
12 is, the user view cucci belonging to those groups, and view its details
[the root @ localhost ~] # groups cucci
[the root @ localhost ~] # CUCCI finger
CUCCI: CUCCI. Journal guanli
13, manually create accounts Student
[root @ localhost ~] # vi / etc / passwd
Student: the X-: 1007: 1007 :: / Home / Handy: / bin / bash
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 ~] # VI / etc / the passwd
[the root @ localhost ~] # chown: Zonghe / Guanli [/ Zonghe
[the root @ localhost ~] # chown:. Journal / Guanli [/. Journal
[the root @ localhost ~] # the chmod 750 / Guanli [
[the root @ localhost ~] # the chmod 750 / Guanli [/ Zonghe
[the root @ localhost ~] # the chmod 750 / Guanli [/. Journal
15, to establish a common directory / ceshi
allow all users within the skill of the group read, write, execute the file
prohibiting other users read, write, execute
[root @ localhost ~] # chmod 770 / ceshi
16, jerry clear user password
[root @ localhost ~] # passwd -d jerry
17, locking cucci password and view the status
[root @ localhost ~] passwd -S CUCCI #
18 is, to modify the user's UID obama 8888
[the root @ localhost ~] # 8888 the usermod -u obama
obama: X: 8888: 1004 :: / Home / obama: / bin / the bash
. 19, by modifying the passwd command maximum password age is 60 days kylin user
[the root @ localhost ~] # 60 Kylin the passwd the -X-
20 is, the user view handy information id groups finger commands
[the root @ localhost ~] # ID handy [the root @ localhost ~] # finger handy
[the root @ localhost ~] # Groups handy

Guess you like

Origin www.cnblogs.com/wangyuiming/p/11272326.html