一、三种基本权限
1、r 读权限 ( read )
2、w 写权限 ( write )
3、x 执行权限 ( execute )
二、权限的操作 :chmod
1、第一种权限操作方式:按组名称操作
chmod 0 a.txt :清空 a.txt 文件的所有权限
chmod u+r a.txt :给a.txt设置所属用户的read权限
chmod g+w a.txt :给a.txt设置组的 write 权限
chmod 0+x a.txt :给a.txt设置其他用户的执行权限
chmod u+rwx a.txt :给所属用户设置read write execute 权限
chmod u=w a.txt :将a.txt所属用户的权限设置为write
2、第二种操作方式:按8进制算法进行操作
chmod 400 a.txt :给 a.txt 所属用户设置read权限
chmod 421 a.txt :给a.txt所属用户设置read权限,组用户设置write权限,其他用户设置execute权限
chmod 357 a.txt :分别给a.txt所属用户设置wx (2+1)权限,所有组设置rx (4+1)权限,其他用户设置rwx(4+2+1)权限
三、用户管理
1、添加用户帐号:useradd
参数:
[root@wingzhe local]# useradd laozhang
[root@wingzhe local]# passwd laozhang
2、删除用户:userdel
3、su:切换用户
四、用户组管理
1、查看有哪些用户组
方法1:
[root@wingzhe ~]# cat /etc/group
方法2:
groupmod + 两次Tab键
[root@wingzhe ~]# groupmod
2、添加删除组:groupadd、groupdel
[root@wingzhe ~]# groupadd MMMMMMMM
[root@wingzhe ~]# groupdel MMMMMMMM
3、查看用户所在组
四、