Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using WinSCP to access Unix computers. How can I change user after I have logged into a Unix server using WinSCP?

E.g. I have personal account in Unix computer A. I can log into this computer using PuTTY and then change user to root user

$sudo /usr/bin/su - rootuser

How can I do the same thing using WinSCP? I don't know the password for rootuser.

share|improve this question

1 Answer 1

There is a FAQ for this question on WinSCP site:
How do I change user after login (e.g. su root)?

You need to specify the sudo command in WinSCP session settings, as a custom shell (if you are using SCP) or use sudo in a custom SFTP server startup command (if you are using SFTP).

Though there are some limitations, notably that you need to configure sudo not to require a password.

See the link for details.

share|improve this answer
    
So how do you get WinSCP to login with sudo? This answer doesn't really make it clear, and the options in the FAQ don't work for me. –  Superbest Aug 12 at 5:44
    
Why it does not work for you? You have to be more specific, if you need help. You should summarize what you have tried and post a new question with your specific problems. –  Martin Prikryl Aug 12 at 8:41
    
In advanced site settings, under Environment/SFTP, SFTP server has two options, I tried both, none gave me access to root-owned directories. Under Environment/Shell, Shell also has some options, but after trying to set these I was also not granted sudo access. I have Ubuntu 14.10, so my server is in /usr/lib/openssh/sftp-server, but using sudo /usr/lib/openssh/sftp-server as the SFTP server gives me an error ("cannot initialize sftp protocol"). I can ask a separate question if this isn't detailed enough. –  Superbest Aug 12 at 13:38
    
@Superbest Again, this is not a discussion forum. If you have a specific problem, ask a new question. –  Martin Prikryl Aug 12 at 13:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.