SFTP and SUDO or SU on Ubuntu

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

SFTP and SUDO or SU on Ubuntu

Post by snorkel » Mon 13 Dec 2010 16:14

Hi,
Is it possible to execute a SUDO -i or SU to allow the SFTP to upload as a different user id?
Reason I ask is it makes it more convenient to upload files that are supposed to be owned by the web server, for example on Ubuntu www-data.
If I can switch to that user I don't have to mess around with changing the owner and permissions after I upload a file.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 14 Dec 2010 10:00

SFTP protocol doesn't allow to change user. To solve the problem you can try starting SSH/SFTP server with access rights of superuser.

snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

Post by snorkel » Tue 14 Dec 2010 17:22

I found a simple solution.
I just added a new non privileged user and set it's user and group ID to the same as the web server, since my app only uses one user it works perfectly.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 15 Dec 2010 08:30

It is good to see that this problem has been solved.

Post Reply