User avatar
TideMan
Posts: 234
Joined: Fri Jun 22, 2012 8:08 am
Location: ChCh, NZ

Running WinSCP as sudo

Sat Mar 23, 2013 10:47 pm

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?

aaa801
Posts: 428
Joined: Mon Jun 04, 2012 9:06 pm
Location: Berkshire

Re: Running WinSCP as sudo

Sat Mar 23, 2013 10:48 pm

why exactly are you running the winscp server as root?

User avatar
TideMan
Posts: 234
Joined: Fri Jun 22, 2012 8:08 am
Location: ChCh, NZ

Re: Running WinSCP as sudo

Sat Mar 23, 2013 10:51 pm

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.
If you wish in this world to advance, your merits you're bound to enhance.
You must stir it and stump it and blow your own trumpet, or trust me you haven't a chance.
Ruddigore, G&S

aaa801
Posts: 428
Joined: Mon Jun 04, 2012 9:06 pm
Location: Berkshire

Re: Running WinSCP as sudo

Sat Mar 23, 2013 10:52 pm

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

xian
Posts: 51
Joined: Thu Nov 01, 2012 8:42 pm

Re: Running WinSCP as sudo

Sat Mar 23, 2013 10:57 pm

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.

User avatar
TideMan
Posts: 234
Joined: Fri Jun 22, 2012 8:08 am
Location: ChCh, NZ

Re: Running WinSCP as sudo

Sat Mar 23, 2013 11:01 pm

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!!
If you wish in this world to advance, your merits you're bound to enhance.
You must stir it and stump it and blow your own trumpet, or trust me you haven't a chance.
Ruddigore, G&S

Return to “General discussion”