如何取消对 root 拥有的文件的保护?

如何取消对 root 拥有的文件的保护?

12.04 LTS 和我错误地set使用以下命令保护了一个名为的文件:

chmod 700 /home/jatin/Desktop/set

我该如何取消保护?

答案1

步骤#1 = 在终端输入“gksu nautilus”。

步骤#2 = 导航到文件或文件夹所在的位置。

步骤 3 = 右键单击​​文件或文件夹,选择“属性”,选择“权限”,然后选择所需的访问设置。如果您不希望文件或文件夹归 root 所有,您还可以更改文件或文件夹的所有者。

之后不要忘记关闭 nautilus 窗口 - 它以 root 权限运行。

截屏:

答案2

答案是:

chmod a+rw filename

检查下表:

#   Permission      rwx
7   full                111
6   read and write      110
5   read and execute    101
4   read only       100
3   write and execute   011
2   write only      010
1   execute only        001
0   none                000

进而

chmod a+r file  read is added for all
chmod a-x file  execute permission is removed for all
chmod a+rw file change the permissions of the file file to read and write for all.
chmod +rwx file On some UNIX platforms such as BSD, this will restore the permission of the file file to default: -rwxr-xr-x.
chmod u=rw,go= file read and write is set for the owner, all permissions are cleared for the group and others
chmod -R u+w,go-w docs  change the permissions of the directory docs and all its contents to add write access for the user, and deny write access for everybody else.
chmod = file    removes all privileges for all.

答案3

如果你可以以 root 身份连接:

更改所有者:

sudo chown user:usergroup /path -R

将用户更改为您自己的

-R 递归,因此里面的所有目录都将归用户所有

更改权限:

sudo chmod 777 /path (An example to give permission drwxrwxrwx) 

sudo chmod 755 /path(授予权限 drwxr-xr-x 的示例)以便组和其他人可以读取和执行。

相关内容