Closed 8 years ago.
您可以创建一个脚本来拦截对远程计算机上 sftp 子系统的调用。 将以下脚本放在远程服务器上的某个位置,比如说 /root/bin/sftp_intercept:
#!/bin/sh exec sudo -u less_privileged_user /usr/lib/openssh/sftp-server
然后像这样进行调用:
sshfs root@remote:dir mountpoint -o sftp_server=/root/bin/sftp_intercept
然后应该会给出所需的结果。
您需要一个适当的 sudoers 条目才能使 sudo 工作而不提示输入密码,并且不要忘记“chmod 755 ~/bin/sftp_intercept”。
另外,请确保 /usr/lib/openssh/sftp-server 确实是 sftp-server 的路径。 如果不是,则可能是 /usr/lib/sftp-server。
You can create a script to intercept the call to the sftp subsystem on the remote machine. Put the following script somewhere on the remote server, let's say /root/bin/sftp_intercept:
and then make the call like so:
That should then give the desired results.
You'll need an apropriate sudoers entry to make sudo work without it prompting for a password, and don't forget to "chmod 755 ~/bin/sftp_intercept".
Also, make sure that /usr/lib/openssh/sftp-server is indeed the path to the sftp-server. If not, then perhaps it is /usr/lib/sftp-server.
sshfs 手册页建议传递
-o uid=$YOURUID -o gid=$YOURGID
给 sshfs 调用时应将您创建的文件的用户/组设置为该 uid/gid。 显然,您需要在远程系统上找到这些。
The sshfs manpage suggests that passing
to your sshfs invocation should set the user/group of the files you create to that uid/gid. You'll need to find these on the remote system, obviously.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(2)
您可以创建一个脚本来拦截对远程计算机上 sftp 子系统的调用。 将以下脚本放在远程服务器上的某个位置,比如说 /root/bin/sftp_intercept:
然后像这样进行调用:
然后应该会给出所需的结果。
您需要一个适当的 sudoers 条目才能使 sudo 工作而不提示输入密码,并且不要忘记“chmod 755 ~/bin/sftp_intercept”。
另外,请确保 /usr/lib/openssh/sftp-server 确实是 sftp-server 的路径。 如果不是,则可能是 /usr/lib/sftp-server。
You can create a script to intercept the call to the sftp subsystem on the remote machine. Put the following script somewhere on the remote server, let's say /root/bin/sftp_intercept:
and then make the call like so:
That should then give the desired results.
You'll need an apropriate sudoers entry to make sudo work without it prompting for a password, and don't forget to "chmod 755 ~/bin/sftp_intercept".
Also, make sure that /usr/lib/openssh/sftp-server is indeed the path to the sftp-server. If not, then perhaps it is /usr/lib/sftp-server.
sshfs 手册页建议传递
给 sshfs 调用时应将您创建的文件的用户/组设置为该 uid/gid。 显然,您需要在远程系统上找到这些。
The sshfs manpage suggests that passing
to your sshfs invocation should set the user/group of the files you create to that uid/gid. You'll need to find these on the remote system, obviously.