2019.7.31 fourth chapter permissions and project management jobs! operation! operation!

1. Create / guanli directory, create two directories zonghe and jishu (a command) in / guanli


[Root @ localhost ~] # mkdir -p / guanli / zonghe | mkdir -p / guanli / jishu


2, add a group account zonghe, caiwu, jishu, GID numbers are set to 2001, 2002

[root@localhost ~]# groupadd -g 2001 zonghe
[root@localhost ~]# groupadd -g 2002 caiwu
[root@localhost ~]# groupadd -g 2003 jishu

 

3. Create jerry, kylin, tsengia, obama user, which kylin user account expire after 30 December 2020

[root@localhost ~]# useradd jeryy
[root@localhost ~]# useradd -e 2020-12-30 kylix
[root@localhost ~]# useradd tsengia
[root@localhost ~]# useradd obama

 

 

4, adding jerry, kylin, tsengia, obama other users into groups zonghe


[root @ localhost ~] # gpasswd -M jeryy, kylix, tsengia, obama zonghe // because it was empty all with -M, if there are users can only use -a
[root @ localhost ~] #

 


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, adding handy, cucci other users into groups jishu

[root @ localhost ~] # gpasswd -a handy jishu
is the user "handy" added to "jishu" group
[root @ localhost ~] # gpasswd -a cucci jishu
is the user "cucci" added to "jishu" group


7, all users are required to be added to the aforementioned group within guanli

root@localhost ~]# groupadd guanli
[root@localhost ~]# gpasswd -M jeryy,kylix,tsengia,obama,handy,cucci guanli

 

 

8, obama users in zonghe group delete
[root @ localhost ~] # vi / etc / group // see all the user's home groups and users

[root @ localhost ~] # gpasswd -d obama zonghe
is the user "obama" delete from "zonghe" group

 

9, set a password for the user jerry is "123456" (using conventional methods)
[the root @ localhost ~] # jeryy the passwd
change the user's password jeryy.
The new password:
Invalid Password: password less than eight characters
Re-enter the new password:
passwd: all authentication tokens have been successfully updated.
[root @ localhost ~] #

Cucci user password is set to "redhat" (use --stdin method)
[root @ localhost ~] # echo "RedHat" | passwd --stdin cucci
change a user's password cucci.
passwd: all authentication tokens have been successfully updated.

10, the jerry user to lock and view the locked state
[root @ localhost ~] # passwd -l jeryy
locked jeryy user's password.

passwd: Operation Success
[the root @ localhost ~] # the passwd -S jeryy
jeryy LK 2019-07-31 99999 0 -1. 7 (password is locked.)

11, two xshell open windows, by (who or w) command to check the connection status, and wherein through a fuser kill
[the root @ localhost ~] # fuser -k / dev / PTS /. 5
/ dev / PTS /. 5: 50421


12, the user view cucci, those belonging to the group, and view its details
[the root @ localhost ~] # Groups cucci
cucci: cucci. Journal Guanli [

// create a yum repository

[root@localhost ~]# yum -y install lynx


13, manually create accounts Student
[root @ localhost ~] # vi / etc / passwd // go in manually created

[Root @ localhost ~] # tail / etc / passwd // then on the View

14, set permissions and ownership:
/ guanli directory is a group set guanli
[root @ localhost ~] # chown: guanli / guanli // Set

[root@localhost ~]# ls -ld /guanli //查看
drwxr-xr-x. 4 root guanli 33 7月 31 10:27 /guanli

Is a group / guanli / zonghe directory to zonghe

[root @ localhost ~] # chown : zonghe / guanli / zonghe / // set
[the root @ localhost ~] # -ld LS / Guanli [/ Zonghe /
drwxr XR-2 X-Zonghe the root. 6 at 10:27 on July 31 /. guanli / zonghe / // View

Is a group / guanli / jishu directory to jishu

[the root @ localhost ~] # chown:. Journal / Guanli [/. Journal /
[the root @ localhost ~] # -ld LS / Guanli [/. Journal /
drwxr XR-2 X-dated the root. Journal. 6. 7 31 10:27 / guanli / jishu. /

Set up three directories are prohibited other user access rights

15, to establish a public directory / ceshi
allow all users to read in the technology group, write, execute the file
prohibit other users to read, write, execute
[root @ likun ~] # setfacl -mg: jishu: rwx / ceshi

[Root @ likun ~] # chmod 770 / ceshi

 

 


16, clear the user password jerry

[root @ localhost ~] # passwd -d jeryy
clear a user's password jeryy.
passwd: Successful operation

17, locking the user's password and view the status cucci

[root @ localhost ~] # passwd -l cucci
locked cucci user's password.
passwd: successful operation
[root @ localhost ~] # passwd -S cucci

cucci LK 2019-07-31 0 99999 7 -1 (password is locked.)

18, the user's UID is modified obama 8888

useradd // you can modify the initial creation, create a good use the usermod
[root @ localhost ~] # the usermod -u 8888 obama

19, kylin modify the user's password by using the passwd command a maximum period of 60 days

[root @ localhost ~] # passwd -x 60 kylix
of the user password aging data kylix.
passwd: Successful operation

20, see the user id groups finger handy information such as command
[root @ localhost ~] # handy the above mentioned id
uid = 1005 (handy) gid = 1005 (handy) groups = 1005 (handy), 2003 ( jishu), 2004 (guanli)

[root@localhost ~]# groups handy
handy : handy jishu guanli

[root@localhost ~]# finger handy

 

Guess you like

Origin www.cnblogs.com/otherwise/p/11280302.html