目录
1.文件
1.1 文件类型
1.2 文件权限
2.用户
2.1 具体用户
su :- 从普通用户到超级用户 在同一个bash下进行身份切换,目录不变
ctrl+d: - 退出超级用户
su - : 使用root重新登陆,默认在家目录下
sudo :对单条指令进行提权
2.2 角色划分
文件的拥有者
文件所属组
文件的other
3.更改权限
3.1 更改文件权限
chmod命令 chmod u/g/o/a +- rwx filename
chmod u+r test.txt chmod g+w test.txt
chmod o+x test.txt chmod u+wx test.txt
chmod g+rx test.txt chmod o+rw test.txt
chmod g-rw test.txt chmod o-rwx test.txt
chmod u+x,g+r,o+x test.txt chmod u-rwx,g-rwx,o-rwx test.txt
chmod a+rw test.txt chmod a-rwx test.txt
。。。
八进制方案修改权限
chmod 777 test.txt
3.2 更改拥有者
更改拥有者需要对方同意,sudo强制
sudo chown root test.txt
3.3 更改所属组
sudo chgrp ws test.txt
3.4 同时更改拥有者和所属组
sudo chown ws:ws test.txt