• Home
  • Disclaimer
  • Contact
  • Archives
  • About
  • Subscribe
  • Support
  • Advertise

Kernel Talks

Unix, Linux, & Cloud!

  • How-to guides
    • Howto
    • Disk management
    • Configurations
    • Troubleshooting
  • OS
    • HPUX
    • Linux
  • Miscellaneous
    • Software & Tools
    • Cloud Services
    • System services
    • Virtualization
  • Certification Preparations
    • AWS Certified Solutions Architect – Associate
    • AWS Certified Solutions Architect – Professional
    • AWS Certified SysOps Administrator – Associate
    • AWS Certified Cloud Practitioner
    • Certified Kubernetes Administrator
    • Hashicorp Certified Terraform Associate
    • Oracle Cloud Infrastructure Foundations 2020 – Associate
  • Tips & Tricks
  • Linux commands
You are here: Home / Software & Tools

How to use sudo access in winSCP

Published: March 1, 2019 | Modified: June 24, 2020



Learn how to use sudo access in winSCP with screenshots.

sudo access in winSCP

Before you move into configurations, make sure that the user is having NOPASSWD access to sudo to target user or root account. This means /etc/sudoers file must have entry something like below –

user1 ALL=(root) NOPASSWD: ALL

Once you have proper sudo configuration you can go ahead with WinSCP config. This is to ensure that once shell tries sudo it should be non-interactive.

First of all, you need to check where is your SFTP server binary located on the server you are trying to connect with WinSCP.

You can check SFTP server binary location with below command –

[root@kerneltalks ~]# cat /etc/ssh/sshd_config |grep -i sftp-server
Subsystem sftp  /usr/libexec/openssh/sftp-server

Here you can see sftp server binary is located at /usr/libexec/openssh/sftp-server

Now open winSCP and click Advanced button to open up advanced settings.

winSCP advance settings

It will open up an advanced setting window like one below. Here select SFTP under Environment on the left-hand side panel. You will be presented with an option on the right hand side.

Now, add SFTP server value here with the command sudo su -c here as displayed in the screenshot below –

SFTP server setting in winSCP

So we added sudo su -c /usr/libexec/openssh/sftp-server in settings here. Now click Ok and connect to the server as you normally do.

After connection, you will be able to transfer files from the directory where you normally need sudo permission to access.

That’s it! You logged to server using WinSCP and sudo access.

⇠ Previous article
How to redirect port in Linux using iptables
Next article ⇢
How to add new disk in Linux

Related stuff:

  • Install and configure checkmk server on Linux
  • How to add product channels in SUSE Manager
  • Installing Ansible and running the first command
  • How to install and uninstall Sophos Antivirus in Linux
  • Install Python 3 on Linux (Redhat, CentOS, Ubuntu)
  • Our list of SUSE Manager articles
  • xsos: a tool to read sosreport in RHEL/CentOS
  • Nginx installation on Linux server
  • Run commands & copy files on salt clients from SUSE Manager Server
  • How to start, stop & restart MariaDB server in Linux
  • All you need to know about sosreport tool
  • How to setup SUSE Manager in AWS server

Filed Under: Software & Tools Tagged With: sudo access in winscp, sudo in winscp, winscp linux sudo

If you like my tutorials and if they helped you in any way, then

  • Consider buying me a cup of coffee via paypal!
  • Subscribe to our newsletter here!
  • Like KernelTalks Facebook page.
  • Follow us on Twitter.
  • Add our RSS feed to your feed reader.

Comments

  1. Jesse says

    April 11, 2019 at 12:51 am

    Does the user profile retain NOPASSWD access to root from then on? If so, how would one protect against malicious executables?

    Reply
    • Shrikant Lavhate says

      April 12, 2019 at 5:07 pm

      NOPASSWD to target account or root account! If you are giving it to root account then you must be knowing user well and hence authorizing his sudo to root with NOPASSWD.

      Reply
  2. akshay teli says

    March 21, 2020 at 12:35 pm

    i am able to login but not able to copy file from local to server. It gives Network error: Software caused connection abort.

    Reply
  3. Ron York says

    June 12, 2020 at 12:55 am

    I get an error connecting. “Cannot initialize SFTP protocol. Is the host running an SFTP server?”

    Reply

Share Your Comments & Feedback: Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get fresh content from KernelTalks

  • Email
  • Facebook
  • RSS
  • Twitter

Get Linux & Unix stuff right into your mailbox. Subscribe now!

* indicates required

This work is licensed under a CC-BY-NC license · Privacy Policy
© Copyright 2016-2026 KernelTalks · All Rights Reserved.
The content is copyrighted to Shrikant Lavhate & can not be reproduced either online or offline without prior permission.