[有用命令]Linux 用户,用户组

时间:2021-08-20 12:31:14

更改文件拥有者 -R 是递归的意思

chown [ -R ] root.work test
将test 文件 改为 拥有者 root , 用户组 work。 chown [ -R ] work test
将test 文件 改为 拥有者 root

更改用户组 -R 是递归的意思

chgrp nagios test
将test 文件 用户组 改为 nagios。

更改文件属性 chmod

用数字改动
chmod 776 test 另一种使用 符号类型改变文件权限 chmod u=rwx,g+r,o+x test
u=rwx,g+r,o+x这一段文字之前不能有空格

改动password

root用户改动自己的password

passwd 然后输入两次password 就改了。

root改动别的用户的password

passwd fupeng 然后输入两次password就 把 fupeng的password改了。