首页 > 文章列表 > Linux用户与用户组命令有哪些

Linux用户与用户组命令有哪些

linux
112 2023-05-22

更改文件拥有者 -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这一段文字之前不能有空格

修改密码
root用户修改自己的密码
passwd 然后输入两次密码 就改了。

root修改别的用户的密码

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