how can i sign in ftp client(winscp) as root?
I use WinSCP as an FTP client. I have access as a normal user, But I want to sign in as a root, How can I do it? Do I Need the same credentials or different?
1 Answer 1
FTP protocol does not allow this. The SFTP and SCP protocols allow for this, but the actual method is platform dependent.
You cannot use sudo from the terminal, so you need to specify it as the "Shell" for the session. This will also require configuration changes in the server.
For the exact details, see the WinSCP FAQ How do I change user after login (e.g. su root)?
![]()
You must log in to answer this question.
-
The Overflow Blog
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.8.2.43556
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Как зайти на компьютер через WinSCP SFTP как root

WinSCP представляет собой свободный графический клиент для протоколов SCP и SFTP. Он разработан под операционную систему Windows. Распространяется WinSCP по лицензии GNU GPL. Используют данный клиент для обеспечения защищённого копирования файлов с компьютера на сервера, которые поддерживают данные протоколы.
Иначе говоря, WinSCP является программой для безопасного копирования файлов между сервером и компьютером.
WinSCP работает с такими протоколами:
- SSH-1;
- SSH-2;
- SCP;
- SFTP.
Основные возможности WinSCP заключаются в том, что с помощью программы, возможно, производить интеграцию с Windows, работать с ключами протокола SSH, сохранять настройки соединений и т.д.
Однако, в работе с данным клиентом могут возникнуть определенные трудности. Например, некоторые пользователи не могут зайти на удаленный компьютер со всеми правами, в качестве root пользователя. Однако эта проблема решается довольно просто и быстро. Всего несколько шагов, и вы избавите себя от этих трудностей.
Далеко не всем известно, что данная программа помимо удобной работы с файлами операционной системы, может еще и организовать удаленную работу с файлами Windows и другими приложениями.
Если на компьютере установлена ОС Windows (любой версии), то для захода на сервер FTP можно использовать вполне стандартные средства. Но далеко не всегда удается получить полный доступ к компьютеру. Причина заключается в том, что прав доступа не имеет программа. Так же не всем известно, как зайти на сервер в статусе root, а дефолтные настройки безопасности не позволяют этого сделать даже по протоколу SSH.
Все, что нужно, это поменять в настройках SSH директиву PermitRootLogin. Для этого в файле меняем настройки SSH, то есть вводим в строку ee /etc/ssh/sshd_config и находим #PermitRootLogin no. Теперь нужно просто заменить ее строкой PermitRootLogin yes. На этом все! Проблема решена и удаленный сервер доступен для входа под root-ом.
How to run sudo command in winscp to transfer files from windows to linux?
When transferring files from a Windows machine to a Linux machine, it is often necessary to use a tool such as WinSCP to securely transfer the files over the network. However, in order to perform certain actions on the Linux machine, it may be necessary to run commands with elevated privileges using the 'sudo' command.
This can present a challenge when using WinSCP, as the tool does not natively support running 'sudo' commands. In this guide, we will discuss several methods for running 'sudo' commands in WinSCP to transfer files from Windows to Linux.
Method 1: Using a SUDO wrapper script
- Create a new script file on the Linux server. For example, /usr/local/bin/sudo-winscp.sh
- Add the following code to the script file:
- Save and close the file.
- Make the script executable with the following command:
- Open WinSCP and go to "Session" > "Advanced Site Settings".
- In the "Advanced Site Settings" dialog, go to the "Environment" tab.
- In the "Environment" tab, add a new variable with the following settings:
- Name: SUDO_ASKPASS
- Value: /usr/bin/ksshaskpass
- Go to the "SFTP" tab and change the "SFTP server" setting to:
- Save the site settings and connect to the Linux server.
- When prompted for a password, enter your sudo password.
- You should now be able to transfer files from Windows to Linux using WinSCP with sudo privileges.
Note: This method assumes that you have sudo privileges on the Linux server and that you have WinSCP installed on the Windows machine.
Method 2: Using the 'sudo' command in WinSCP's terminal emulator
To use the 'sudo' command in WinSCP's terminal emulator to transfer files from Windows to Linux, follow these steps:
Open WinSCP and connect to your Linux server.
Navigate to the directory where you want to transfer the files.
Click on the 'Terminal' button in the toolbar to open the terminal emulator.
Type the following command to switch to root user:
This will prompt you to enter the root password.
Once you have switched to root user, you can use the 'scp' command to transfer files from your Windows machine to the Linux server. For example, to transfer a file named 'file.txt' from your Windows desktop to the current directory on the Linux server, use the following command:
Note that the period at the end of the command specifies the current directory on the Linux server.
If you encounter any permission issues while transferring the files, you can use the 'chmod' command to change the permissions of the destination directory. For example, to give read, write, and execute permissions to all users, use the following command:
This will give full permissions to the current directory.
That's it! You should now be able to transfer files from your Windows machine to the Linux server using the 'sudo' command in WinSCP's terminal emulator.
Method 3: Using a dedicated SFTP server with 'sudo' capabilities
To transfer files from Windows to Linux using WinSCP and run SUDO command, we can use a dedicated SFTP server with 'sudo' capabilities. Here are the steps:
Install and configure OpenSSH server on the Linux machine.
Create a new user on the Linux machine with sudo privileges.
Install and configure an SFTP server on the Linux machine with sudo capabilities. For example, we can use VSFTPD or ProFTPD.
Configure the SFTP server to allow the new user to access the server and set the appropriate permissions.
Install WinSCP on the Windows machine.
Open WinSCP and create a new session for the SFTP server.
In the Advanced Site Settings, go to the "Environment" tab and add the following command to the "SFTP server startup command" field:
Save the settings and connect to the SFTP server.
Now, we can transfer files from Windows to Linux using WinSCP and run SUDO command by simply prefixing the command with "sudo" in the remote path field. For example, to copy a file to the /etc directory with sudo privileges, we can use the following remote path:
Here's an example of how to copy a file to the /etc directory with sudo privileges using WinSCP:
This will copy the file from the local machine to the remote machine with sudo privileges.
In conclusion, by using a dedicated SFTP server with sudo capabilities, we can easily transfer files from Windows to Linux using WinSCP and run SUDO command.
Как настроить доступ к серверу через WinSCP с правами root?
Не могу получить доступ к серверу DO (DigitalOcean) через ssh
Перечитал раз 20 наверное манула который даёться на сайте DO, на ютубе дофига видосов, но ничего.
Удаленный доступ к серверу, как настроить?
Приветствую профессионалов ИТ! Прошу подсказать, как настроить Удаленный доступ с десктопа к.
Как настроить доступ к игровому серверу CS 1.6 для двух локальных сетей
Добрый день, есть 2 локальные сети соединенные как показано на схеме. Задача создать 1 сервер CS.
Как предоставить доступ к серверу через интернет
Доброго времени суток. Подскажите, как предоставить доступ к серверу MS SQL через интернет. На.
1. Нет, возможности дать вашему пользователю права как у root’а нет и не надо.
2. Действительно, возможность входа по ssh root’ом — плохая идея.
А что за сценарий работы у вас, что вам необходимо работать в текстовом редакторе обязательно с правами root’а?
Если вы конфиги правите, то это же не постоянные действия, достаточно зайти под user’ом потом до root’а и правка.
Если вы кодите на сервере, зачем это делать из-под root’а?
Что именно вам на сервере надо делать, опишите может есть правильное решение?