用户权限
查看当前用户
Section titled “查看当前用户”whoami
# 查看用户的uid gid groupsid查看用户所属组
Section titled “查看用户所属组”groups
# 查看系统全部的组cat /etc/groupgroupadd group1
# 删除组groupdel group1# m:在home目录创建文件夹,G:用户所属组useradd -m -G root,group1 testuser
# 切换用户,su:switch usersu testuser
# 切换组newgrp root修改用户密码
Section titled “修改用户密码”passwd root-:表示文件,d:表示目录r:w:x:permissions:(当前owner的权限)(group的权限)(其他用户的权限)-rwxrwxrwx# 给所有用户添加执行权限chmod a+x a.txt
# 给所有用户添加读写执行权限chmod a+rwx a.txt# 或chmod 777 a.txt# 给dir1目录及其内的文件添加读写执行权限chmod -R 777 dir1
# 只有读写权限chmod 666 a.txt
# 移除所有权限chmod 000 a.txt
# 给当前用户添加可写权限chmod u+w a.txt
# 移除其他用户的可读权限chmod o-r a.txt