开发者

How to use sudo over SFTP with CyberDuck?

开发者 https://www.devze.com 2023-01-09 13:58 出处:网络
I\'m copying this question from over here: http://getsatisfaction.com/cyberduck/topics/can_i_use_sudo_over_sftp_with_cyberduck

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 e开发者_C百科nable root access?


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 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,

How to use sudo over SFTP with CyberDuck?

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.

How to use sudo over SFTP with CyberDuck?

How to use sudo over SFTP with CyberDuck?


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.


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 chown -R $(whoami) /your/current/dir
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号