How to use sudo over SFTP with CyberDuck?

与世无争的帅哥 提交于 2019-12-02 18:46:40

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.

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.

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.

It is possible to start the remote SFTP server with sudo but I doubt you could find any SFTP GUI client supporting that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!