Code Robo
Virtual Service
Comparator
Tester
Converter
Utility
Java Code Complience
Validator
Formatter
EncoderDecoder



How to run SUDO command in WinSCP
       Talk to EasyAssistant

How do I login as a root in WinSCP.

This page tells you how to connect in WinSCP with root user or how to run sudo su command from WinScp after login. I was connecting through WinSCP to transfer files from my windows laptop to a RED Hat linux machine in AWS cloud. I was using private key for authentication. However the files was not getting transfered as the user account to be used had to have root access. For this task, We need to elevate to root user after login.

Now question is how can I elevate a loged in user to root user in WinScp (SFTP) or How can I run sudo su When I am using WinScp to upload or downlod files.

Good news is that , WinSCP can elevate loged in user to root after login if we set up some values;

Please follow the following steps.


1. Login to your linux m/c using Putty and find location of sftp-server location. It varies from OS to OS


 sudo su
 cd /
 find -name sftp-server

In my linux (RedHat)m/c path is : /usr/libexec/openssh/sftp-server

sft-server location in linux m/c


2. Open WinScp. Navigate to (Session > Sites > Site Manager)


WinScp site manager


3. Select the saved session and click on the "Edit" button.


click on edit button


4. Click on Advanced button. Then navigate to SFT > SFTP Server.
Set the value sudo su -c /usr/libexec/openssh/sftp-server

click on edit button


5. Save the value and login.
WinScp Login

Now you should be logged in succesfully and current user will be elevated to root user. I mean current user will have root access.


Post Your Comment:
Name :
Email ( Optional) :
Comments / Suggestion (* Required) It is required: :
: