Page 1 of 1

Running WinSCP as sudo

Posted: Sat Mar 23, 2013 10:47 pm
by TideMan
I want to copy some files from Windows to /var/www, so I'd like to have sudo access when running WinSCP.
On the web I found instructions to click open Advanced Options in WinSCP, then in the SFTP box to insert:

Code: Select all

sudo su -c /usr/lib/openssh/sftp-server
but this doesn't seem to work, giving me a permissions error when I try to copy.
I found another site that suggests inserting this:

Code: Select all

sudo /usr/lib/openssh/sftp-server
but this doesn't work either.

Anybody got a better suggestion?

Re: Running WinSCP as sudo

Posted: Sat Mar 23, 2013 10:48 pm
by aaa801
why exactly are you running the winscp server as root?

Re: Running WinSCP as sudo

Posted: Sat Mar 23, 2013 10:51 pm
by TideMan
aaa801 wrote:why exactly are you running the winscp server as root?
In order to copy files from my Windows machine to /var/www on the RPi.

Re: Running WinSCP as sudo

Posted: Sat Mar 23, 2013 10:52 pm
by aaa801
TideMan wrote:
aaa801 wrote:why exactly are you running the winscp server as root?
In order to copy files from my Windows machine to /var/www on the RPi.
Ok then why not set a password to the root account and login as root to the pi via winscp?
wait a min, you know winscp can connect directly to ssh, what is this winscp-server thing

Re: Running WinSCP as sudo

Posted: Sat Mar 23, 2013 10:57 pm
by xian
If you will be the sole user to write to /var/www you could chown it to yourself, or there are other ways of using the permissions. Using root privileges seems a bit overkill to me.

Re: Running WinSCP as sudo

Posted: Sat Mar 23, 2013 11:01 pm
by TideMan
aaa801 wrote:[

Ok then why not set a password to the root account and login as root to the pi via winscp?
Doh...................
Why didn't I think of that?
Works perfectly!!