[root@server ~]# id root
用户id=0(root) 组id=0(root) 组=0(root)
[root@server ~]# id kxy
用户id=1000(kxy) 组id=1000(kxy) 组=1000(kxy),10(wheel)
[root@server ~]# useradd test1
[root@server ~]# id test1
用户id=1001(test1) 组id=1001(test1) 组=1001(test1)
[root@server ~]# useradd -u 2021 test2
[root@server ~]# id test2
用户id=2021(test2) 组id=2021(test2) 组=2021(test2)
[root@server ~]# userdel test1
[root@server ~]# userdel test2
[root@server ~]# useradd test3
[root@server ~]# echo "123456" | passwd --stdin test3 >> /dev/null
[root@server ~]# usermod -u 5000 test3
[root@server ~]# id test3
用户id=5000(test3) 组id=1001(test3) 组=1001(test3)
[root@server ~]# groupadd test1
[root@server ~]# gpasswd -a test3 test1
正在将用户“test3”加入到“test1”组中
[root@server ~]# cat /etc/passwd | tail -1
test3:x:5000:1001::/home/test3:/bin/bash
[root@server ~]# su - test3
[test3@server ~]$
[root@server ~]# useradd -s /sbin/nologin test4
[root@server ~]# echo "123456" | passwd --stdin test4 >> /dev/null
[root@server ~]# su - test4
This account is currently not available.
[root@server ~]# sudo ls -l /etc/
[root@server ~]# mkdir t1
[root@server ~]# cd t1
[root@server t1]# touch temp1.txt
[root@server t1]# ll temp1.txt
-rw-r--r--. 1 root root 0 9月 29 14:48 temp1.txt
[root@server t1]# chmod 777 temp1.txt
[root@server t1]# ll temp1.txt
-rwxrwxrwx. 1 root root 0 9月 29 14:48 temp1.txt
[root@server t1]# touch temp2.txt
[root@server t1]# chmod 664 temp2.txt
[root@server t1]# ll temp2.txt
-rw-rw-r--. 1 root root 0 9月 29 14:55 temp2.txt
[root@server ~]# useradd -p "123456" test5
[root@server ~]# cat /etc/passwd | tail -1
test5:x:1001:1001::/home/tets5:/bin/bash
[root@server ~]# touch temp3.txt
[root@server ~]# chown test5:test5 temp3.txt
[root@server ~]# ll temp3.txt
-rw-r--r--. 1 test5 test5 0 9月 29 15:01 temp3.txt
[root@server ~]# mkdir k1
[root@server ~]# cd k1
[root@server k1]# touch temp4.txt
[root@server k1]# lsattr temp4.txt
---------------------- temp4.txt
[root@server k1]# echo "hello" >> temp4.txt
[root@server k1]# cat temp4.txt
hello
[root@server k1]# chattr +a temp4.txt
[root@server k1]# lsattr temp4.txt
-----a---------------- temp4.txt
[root@server k1]# rm -f temp4.txt
rm: 无法删除 'temp4.txt': 不允许的操作
[root@server k1]# chattr -a temp4.txt
[root@server k1]# lsattr temp4.txt
---------------------- temp4.txt
[root@server k1]# rm -f temp4.txt