1

我不知道如何在计算机“remote”上安装远程目录“remote_dir”,具有远程 gid“wgrp”。欢迎帮助。

  me@local$ sshfs me@remote:/remote_dir remote_as_wgrp ...wanted_options...

一种解决方法是创建一个属于组“wgrp”的新用户“me_wgrp”。但这个问题在概念上似乎很简单,我确信有一个解决方案。

上下文:
我可以在远程计算上使用 ssh 进行连接,然后更改我的 gid:

  我@local$ ssh 我@remote
  我@remote$ newgrp wgrp

现在我可以在只能由组“wgrp”写入的目录中创建文件。

我努力了

  sshfs me@remote:/remote_dir remote_as_wgrp -o ssh_command='newgrp wgrp'

但 sshfs 似乎被阻止了。

另外,如果我尝试

  ssh me@remote 'newgrp wgrp'

ssh 不给出提示,但它接受命令。

4

3 回答 3

0

您应该考虑更改远程主机上的默认组 newgrp 将永远不会返回,因为它会打开一个新的 shell。“ newgrp - 让您返回到新 shell 的提示符。”

于 2011-04-28T16:08:49.793 回答
0

unfortunately it looks like newgrp group, or "newgrp group -" causes sshfs to not work in the newgrp environment. You won't be able to cd into the sshfs directory or ls, basically you'll get a permission denied error (and it's not due to permissions issues). You'll also notice that df no longer shows the sshfs fuse mount.

于 2011-12-05T01:53:02.187 回答
0

问这个问题十年后,我自己也需要这个。

我发现现在可以给 sshfs 添加一个参数了:

sshfs -o sftp_server="sg <group> -c '/usr/lib/misc/sftp-server -u <umask>'" ...

where/usr/lib/misc/sftp-server是远程系统上 sftp-server 的位置,是远程系统<group>上所需的组,并且-u <umask>是为特定 sftp-server 提供默认 umask 的可选方式。

于 2020-05-29T12:18:27.960 回答