Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 可以创建/编辑组文件,但可以';不要更改权限_Linux_Permissions_Sftp - Fatal编程技术网

Linux 可以创建/编辑组文件,但可以';不要更改权限

Linux 可以创建/编辑组文件,但可以';不要更改权限,linux,permissions,sftp,Linux,Permissions,Sftp,我的设想是: 2个用户:开发者组中的第一个用户和第二个用户 此用户使用sftp连接到服务器 如果firstUser创建了一个文件,那么这个文件是775,由firstUser,group developers拥有 使用secondUser,我可以编辑和写入此文件,但如果我尝试: chmod 777 testfile.txt 我不能那样做 能否提供“ls-l testfile.txt”的结果。有两种方法可以尝试解决此问题。我不确定它们是否是最好的方法,但它们在这里。在chmod之前添加sudo,

我的设想是:

2个用户:开发者组中的第一个用户和第二个用户

此用户使用sftp连接到服务器

如果firstUser创建了一个文件,那么这个文件是775,由firstUser,group developers拥有

使用secondUser,我可以编辑和写入此文件,但如果我尝试:

 chmod 777 testfile.txt

我不能那样做

能否提供“ls-l testfile.txt”的结果。有两种方法可以尝试解决此问题。我不确定它们是否是最好的方法,但它们在这里。在chmod之前添加sudo,例如“sudo chmod 777 testfile.txt”,并提供根密码。或者您可以更改所有者,例如'chown secondUser:developersgroup testfile.txt',然后更改chmod。

只有root或所有者可以这样做。

-rwxr-x 1 firstUser developers 0 nov 15 16:41 secondUser可以删除此文件但不能更改权限,然后在命令之前使用sudo并使用root密码,或者更改所有者,“chown secondUser:developers testfile.txt”然后使用“chmod 777 testfile.txt”。