1

Recently I completely switched to Ubuntu for my work computer. But I have one problem. On Windows I used WinSCP to connect to remove development server via SFTP and I can't find any app for Ubuntu that would work for me here. The problem is not the SFTP itself - I can connect to the server without any problems - however I need to login as unprivileged user and then run sudo to be able to traverse into directories my unprivileged user can't access.

In WinSCP I could configure my WinSCP server as sudo su -c /bin/sftp-server and as shell I had to put sudo su -.

Is there any app that can connect to SFTP in simmiliar matter like WinSCP could on Windows?

1
  • "I need to login as unprivileged user and then run sudo to be able to traverse into directories my unprivileged user can't access" - wouldn't it be easier to give rights to your user (perhaps by group membership) to access these directories? May 14 at 10:58

1 Answer 1

0

If you like the GUI-ness of WinSCP, then try something like Filezilla. It's available on ubuntu with sudo apt install filezilla. It supports the SFTP protocol.

In terms of being able to access the files you need, this is a server configuration issue. If things can only be accessed via root, then simply sftp as user root.

It's possible this won't work. It's common for sshd servers to be configured with PermitRootLogin prohibit-password or PermitRootLogin no. In that case you should do something server-side. It sounds like you already have the root password, so this should be possible.

Idea 1: Ensure the files are owned by your user, or at least world-readable. If you need to send files to a directory, ensure those directories are owned by your user or world-writable. This is the best solution as you shouldn't need full root permission for simple file-server access.

Idea 2: If /etc/ssh/sshd_config has PermitRootLogin prohibit-password, Add your public ssh key (~/.ssh/id_rsa.pub) to the server at /root/.ssh/authorized_keys. Then ensure your client (Filezilla) uses your private ssh key.

Idea 3: If /etc/ssh/sshd_config has PermitRootLogin no, change it to PermitRootLigin prohibit-password, sudo systemctl restart sshd, then continue with Idea 2.

Idea 4: In /etc/ssh/sshd_config, set PermitRootLogin yes and then sudo systemctl restart sshd. Then you can login as user root using root's password. This is the least secure because people can try to guess the password. This is also the easiest solution.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .