如何通过 CyberDuck 通过 SFTP 使用 sudo?
我从这里复制这个问题:http://getsatisfaction.com/cyberduck/topics/can_i_use_sudo_over_sftp_with_cyberduck
我遇到了同样的问题,并且很难找到答案:
我通过 SFTP 使用 Cyberduck。我可以 连接和浏览文件很好,但是 当我尝试上传时,我得到一个 权限错误。网络主机说我 需要使用“sudo”命令。我知道 如何通过终端执行此操作,但它是 可以告诉 Cyberduck 使用 须藤?
请不要告诉我使用 root,因为:
如果您没有 root 访问权限或 不想启用 root 访问权限?
I'm copying this question from over here: http://getsatisfaction.com/cyberduck/topics/can_i_use_sudo_over_sftp_with_cyberduck
I am having the same issue and finding it hard to find an answer:
I am using Cyberduck over SFTP. I can
connect and browse files fine, but
when I try to upload, I get a
permissions error. Web host says I
need to use the 'sudo' command. I know
how to do this via Terminal, but it is
possible to to tell Cyberduck to use
sudo?
Please don't tell me to use root because:
What if you don't have root access or
don't want to enable root access?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我认为最好的解决方案是在 ssh 中使用 sudo 来修改权限。您甚至可以编写一个小的 shell 脚本来在工作时授予访问权限,并在完成后将权限设置回来。
我实际上很好奇是否有更好的方法来做到这一点,但我很确定没有。
I think the best solution is to use your sudo in ssh to modify permissions. You could even write a small shell script to give you access while you are working and set the permissions back when you are done.
I am actually curious if there is a better way to do this, but I am pretty sure that there is not.
如果您有权访问服务器,您也许可以通过 ssh 用户声明该目录的所有权。之后,您应该能够在不使用
sudo
的情况下复制和编辑数据。If you have access to the server, you might be able to claim ownership for the directory with your ssh user. After that you should be able to copy and edit data without using
sudo
.可以使用 sudo 启动远程 SFTP 服务器,但我怀疑您能否找到任何支持该服务的 SFTP GUI 客户端。
It is possible to start the remote SFTP server with sudo but I doubt you could find any SFTP GUI client supporting that.
我使用 cyberduck 将文件上传到可以写入的文件夹(例如 cyberduck 连接用户的主文件夹)。然后我通过 ssh 登录到机器,并 sudo mv 将文件复制到所需的目标文件夹。
I upload the file with cyberduck to a folder where i can write to (e.g. the home folder of the cyberduck connected user). Then i login to the machine via ssh and sudo mv the file to the desired destination folder.
我已经有很长一段时间遇到同样的问题了,我已经放弃了简单地使用 putty 来编辑文件,或者将它们从我的主目录中移动。
不幸的是,这只是部分答案,因为它不能在 Linux 中本地工作。不过你也许可以在葡萄酒中使用它。
事实证明可以使用winscp 来做到这一点。
在winscp中设置一个新的SFTP会话,
之后,转到设置的 SFTP 部分,选择自定义 SFTP 服务器,然后输入路径到远程 sftp-server 二进制文件,并在其前面附加 sudo -s 。为此,您需要启用无需密码运行 sudo。您可以在远程服务器上使用 whereis 命令查找 sftp-server 的路径。
I had this same problem for a really long time, and I had resigned to simply using putty to edit files, or moving them from my home directory.
Unfortunately this is only a partial answer, as it does not work natively in linux. You might be able to use it in wine though.
Turns out it is possible to do this using winscp.
Setup a new SFTP session in winscp,
After that, go to the SFTP section of the setup, select a custom SFTP server, and type in the path to the remote sftp-server binary with sudo -s appended before it. For this to work you need to enable running sudo without a password. You can use the whereis command on the remote server to find the path to sftp-server.