2019.7.31 and vesting rights management (title)

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

mkdir / guanli / {zonghe, jishu}

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

-g 2001 Zonghe groupadd
groupadd -g 2002 caiwu
groupadd -g 2003. Journal

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

useradd jerry
useradd -e 2020-12-30 kylin
useradd tsengia
useradd obama


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

gpasswd -M jerry,kylin,tsengia,obama zonghe

5, create a handy, cucci users, cucci account login Shell is set to "/ sbin / nologin"

useradd handy
useradd -s /sbin/nologin cucci

6, adding handy, cucci other users into groups jishu

gpasswd -M handy,cucci jishu

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

gpasswd -M jerry,kylin,tsengia,obama,handy,cucci guanli

8, obama users in zonghe group deleted

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

passwd jerry
echo '123' | passwd --stdin cucci

10, the jerry user to lock and view the locked state

passwd -l jerry
passwd -S jerry

11, two xshell open windows, by (who or w) command to check the connection status, and wherein through a fuser kill

who/w
fuser -k /dev/pts/6

12, see cucci users belong to those groups, and to view its details

groups cucci
yum -y install finger
finger cucci

13, manually create an account student

useradd 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

chown: Guanli [/ Guanli [
chown: Zonghe / Guanli [/ Zonghe
chown:. Journal / Guanli [/. Journal
chown -R & lt 750 / 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

setfacl -m g:jishu:rwx /tmp/ceshi
chown -R 770 /tmp/ceshi

16, clear the user password jerry

passwd -d jerry

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

passwd -l cucci
passwd -S cucci

18, the user's UID is modified obama 8888

usermod -u 8888 obmam

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


passwd -x 60 kylin

20, see the user handy information id groups finger commands

id handy
groups handy
finger handy

Guess you like

Origin www.cnblogs.com/990624lty-jhc/p/11274320.html