Winscp как подключиться к centos

Обновлено: 06.07.2024

копирование файлов из windows в linux

Иногда перед системными администраторами, особенно начинающими встает задача скопировать какой-то файл в CentOS, Ubuntu, Debian, FreeBSD, многие просто не знают, как это делается так как привыкли к Windows, другие используют ftp серверы и всякое такое, но есть способ с 100 раз проще с помощью файлового менеджера WinSCP, который работает по ssh. Сегодняшней темой будет описание ситуации, как происходит копирование файлов из windows в linux , уверен, что вам это окажется полезным.

Как перенести файл из Windows в Linux

Банальная ситуация, вам необходимо перенести файл драйвера или какого-либо пакета в вашу CentOS, на которой может не быть интернета, либо же файл, может быть огромного размера (дополнительные диски с софтом), случаи бываю разные. Вы как системный администратор, должны уметь копировать файл из Windows в Linux, по сети. Для решения нашей задачи есть, несколько утилит:

  • WINSCP
  • FileZilla
  • Total Commander

Копирование файлов в Linux, через WinSCP

Скачиваете программу с официального сайта, там нет ничего сложного. Как поставить WinSCP описано тут. Запускаем, первое что нужно сделать это указать адрес сервера для ssh сессии. Жмем кнопку "New" для создания нового подключения.

Как из windows скопировать файл на CentOS, Ubuntu, Debian, FreeBSD-01

Как из windows скопировать файл на CentOS, Ubuntu, Debian, FreeBSD-01

Вводим адрес и логин и жмем login. Обратите внимание, что подключение к серверу с Linux, будет осуществляться по протоколу SFTP.

Как из windows скопировать файл на CentOS, Ubuntu, Debian, FreeBSD-02

Как из windows скопировать файл на CentOS, Ubuntu, Debian, FreeBSD-02

вводим пароль, что уже означает, что сессия установлена.

Как из windows скопировать файл на CentOS, Ubuntu, Debian, FreeBSD-03

Как из windows скопировать файл на CentOS, Ubuntu, Debian, FreeBSD-03

и видим две панели слева это ваш компьютер, а справа это ваш linux. Как видите все очень удобно. Вы выбираете в левой половине нужный вам файл, перемещаясь по каталогам, далее вы выбираете с правой стороны, в какой из каталогов вы будите пытаться скопировать файл по ssh в linux.

скопировать файл по ssh linux

Далее, как только файл выбран, нажмите клавишу F5, у вас появиться окно с подтверждением копирования. Нажимаем "ок" и файл будет перенесен в вашу Linux платформу. Как видите доступ к файлам windows из linux получен.

доступ к файлам windows из linux

Копирование данных в Linux, через FileZilla

FileZilla - это удобная утилита, позволяющая так же как и WinSCP, устанавливать ssh подключения к линукс платформам по протоколу SFTP. Где скачать и как установить FileZilla, я вам рассказывал, на этом останавливаться не буду.

Далее вы открываете утилиту. в самом верху вы задаете:

  • Хост - адрес подключения
  • Имя пользователя
  • Пароль
  • Порт, по необходимости, если он не стандартный.

Настройка подключение в FileZilla

Настройка WinSCP

И так, напоминаю, что WinSCP - это бесплатный sftp клиент, аля файловый менеджер, который позволяет пользователям Windows платформ в удобном и главное защищенном виде производить подключение к серверам CentOS, Debian, Ubuntu. Утилита сразу обрела себе славу и любовь обычных пользователей, и это не мудрено, так как она тонко позволяет производить настройку под себя.

Ранее я уже рассказывал, где скачать утилиту WinSCP, и как ее установить. Если вы пропустили данные статьи, то всегда можете с ними ознакомиться. Теперь, давайте поговорим, как нам сделать утилиту Putty, клиентом для подключения по ssh из интерфейса WinSCP. Первое, что вы делаете, это производите установку Putty. Напоминаю, ее официальный сайт.

Скачивание putty

Далее вы ее устанавливаете, хотя можете и использовать Portable версию, кому как удобнее. Процесс инсталляции Putty очень простой. На первом шаге, просто нажимаем "Next"

Установка putty

Далее задаем в какой каталог будет производиться установка утилиты.

Установка putty-02

Оставляем все настройки по умолчанию.

Установка putty-03

Через пару секунд, ваша Putty будет установлена в системе.

Установка putty-04

Далее вы запускаете утилиту WinSCP. На экране входа, в левом нижнем углу, нажмите кнопку "Инструменты (Tools)"

Настройка putty в winscp-01

Выбираем пункт "Настройки"

Настройка putty в winscp-02

В открывшихся настройках, перейдите на вкладку "Интеграция - Программы". Убедитесь, что у вас в строке "Пусть к PUTTY/Терминалу" выставлен путь до вашего exe файла, который открывает Putty. Если у вас portable версия, то вы можете через кнопку "Обзор" изменить до него путь. Так же советую поставить галку "Помнить пароль сессии и передавать его Putty (ssh)", чтобы постоянно не набивать пароль. Сохраняем настройки.

Хочу отметить, что вы тут можете указать .абсолютно любой терминал клиент, например mRemoteNG

Настройка putty в winscp-03

Еще небольшой совет, вам необязательно пользоваться встроенным текстовым редактором в WinSCP, вы его легко можете поменять. Для этого зайдите на вкладку "Редакторы" и через кнопку "Добавить" вы можете указать альтернативный, в моем случае, это Notepad++. Через кнопку "Вверх" поднимите его на первую позицию.

Добавление notepad++ в winscp

теперь, как же вам использовать из интерфейса WinSCP ваш ssh клиент Putty, дабы создать подключение или нажать Shift+f3. Тут все просто кликаете по значку терминала.

putty в winscp

В итоге, у вас не будет запрошен логин и пароль, так как мы до этого ставили опцию, что они будут передаваться из подключения WinSCP. Как видите все очень удобно и функционально.

I am trying to use WinSCP to transfer files over to a Linux Instance from Windows.

I'm using private key for my instance to login to Amazon instance using ec2-user. However ec2-user does not have access to write to the Linux instance

How do I sudo su - to access the root directory and write to the linux box, using WinSCP or any other file transfer method?


4,017 4 4 gold badges 24 24 silver badges 48 48 bronze badges 607 1 1 gold badge 5 5 silver badges 10 10 bronze badges

8 Answers 8

I know this is old, but it is actually very possible.

Go to your WinSCP profile (Session > Sites > Site Manager)

Click on Edit > Advanced. > Environment > SFTP

Insert sudo su -c /usr/lib/sftp-server in "SFTP Server" (note this path might be different in your system)

Save and connect

enter image description here

AWS Ubuntu 18.04:

3,625 3 3 gold badges 32 32 silver badges 40 40 bronze badges


@Mr.Shan0 I love you :D FYI I think this is for Amazon Linux 2 which is CentOS-based. Amazon Linux is Ubuntu-based and uses /usr/lib/sftp-server

AFAIK you can't do that.
What I did at my place of work, is transfer the files to your home (

) folder (or really any folder that you have full permissions in, i.e chmod 777 or variants) via WinSCP, and then SSH to to your linux machine and sudo from there to your destination folder.

Another solution would be to change permissions of the directories you are planning on uploading the files to, so your user (which is without sudo privileges) could write to those dirs.

Closed 7 years ago .

I love WinSCP for Windows. What is the best equivalent software for Linux?

I tried to use sshfs to mount the remote file system on my local machine, but it is not as user friendly as simply launching a GUI, plus it seems to require root access on the client machine, which is not very convenient.

Of course command-line tools such as scp are possible, but I am looking for a simple GUI.


29.1k 21 21 gold badges 97 97 silver badges 124 124 bronze badges 42.1k 31 31 gold badges 144 144 silver badges 171 171 bronze badges - sshfs requires a user who has permissions to whatever file/folder you need access to on the remote machine. - you can also script the sshfs connection string into a shell script and just execute it whenever you want, instead of retyping. - Ubuntu supports bookmarks for connections in Nautilus I assume somebody has told you that "winscp" is the windows equivalent of scp , right?

15 Answers 15

If you're using GNOME, you can go to: PlacesConnect to Server in Nautilus and choose SSH. If you have an SSH agent running and configured, no password will be asked! (This is the same as sftp://root@servername/directory in Nautilus)

In Konqueror, you can simply type: fish://servername.

Per Mike R: In Ubuntu 14.04 (with Unity) it’s under FilesConnect to Server in the menu or NetworkConnect to Server in the sidebar.


29.1k 21 21 gold badges 97 97 silver badges 124 124 bronze badges 4,243 2 2 gold badges 17 17 silver badges 12 12 bronze badges great answer Bash, thank you. FYI, fish://servername also works in Dolphin. You can try PCManFM ( apt-get install pcmanfm ), just another File Manager like Nautilus and Thunar, but I find it better. In the main menu just click Go --> Connect to server. and you get a GUI for connections, plus you can bookmark them, and what I find best is that you can just right click on files and use "open with.." and use your favorite programs, just like your local files! In Ubuntu 14.0.4 its under Files > Connect to Server in the Menu or Network > Connect to Server in the sidebar

FileZilla is available for Linux. If you are using Ubuntu:

Otherwise, you can download it from the FileZilla website.


29.1k 21 21 gold badges 97 97 silver badges 124 124 bronze badges


30.5k 14 14 gold badges 70 70 silver badges 77 77 bronze badges Filezilla + SFTP offers processor-bottlenecked transfer speed.

I use FileZilla and it works fine with SFTP (SSH File Transfer Protocol). Follow these steps to install it and configure it:

1. Install FileZilla via terminal:

2. Open the program and go to menu FileSite Manager. or simply type Ctrl + S

Enter image description here

3. The following window should appear:

4. Enter the name of your host, select the port (usually 22 for ssh/scp/sftp) and choose SFTP - SSH File Transfer Protocol as the protocol and optionally set the Logon Type to Normal if authentication is needed, then enter your data.


3,427 3 3 gold badges 27 27 silver badges 41 41 bronze badges This did the trick for me! Needed secure access, and had filezilla already installed! "Connect to Server" in nautilus is almost enough for me in development, but FileZilla is a great complement in some circumstance. What is "resp."? "respectively"? Or something else? @PeterMortensen this answer was written many years ago when my English was noticeably worse. I replaced "resp." with "then", since it seems to make the most sense.

A Xfce/Thunar solution is basically the same as GNOME/Nautilus:

Simply type sftp://yourhost/ in the address line in Thunar (you can get there by Ctrl + L ).

(The authorization is identical to ssh / scp , i.e. with proper use of file

/.ssh/config , keys and ssh-agent, you can achieve decent ease and security: server alias + no passwords asked.)


29.1k 21 21 gold badges 97 97 silver badges 124 124 bronze badges 9,673 6 6 gold badges 49 49 silver badges 68 68 bronze badges This worked for me. But only after I cleared up a warning from an old entry in the known_hosts file. Prior to that Thunar just timed out when trying to log in without any details as to why. So make sure you can ssh in cleanly without warnings first.

/Path/to/your/key then try connecting .

To run WinSCP under Linux (Ubuntu 12.04 (Precise Pangolin)), follow these steps:

Done! WinSCP will run like in a Windows environment!


29.1k 21 21 gold badges 97 97 silver badges 124 124 bronze badges @TomaszGandor, First I thought root is needed for installing dependencies which are necessary. But even after all dependencies are installed, root is needed to run WinSCP.


29.1k 21 21 gold badges 97 97 silver badges 124 124 bronze badges 21.1k 5 5 gold badges 76 76 silver badges 103 103 bronze badges that feature of Konqueror is super useful. I use it a lot.

I've used gFTP for that.

10.1k 5 5 gold badges 32 32 silver badges 48 48 bronze badges

WinSCP works fine on Linux under Wine. I installed Wine and WinSCP and had no problems.


29.1k 21 21 gold badges 97 97 silver badges 124 124 bronze badges

Use FireFTP, Krusader, and other similar applications.


29.1k 21 21 gold badges 97 97 silver badges 124 124 bronze badges

Nautilus can be used easily in this case.

For Fedora 16, go to menu FileConnect To Server, select the appropriate protocol, enter required details and simply connect. Just make sure that the SSH server is running on the other side. It works great.

This is valid on Ubuntu 14.04 (Trusty Tahr) as well.


29.1k 21 21 gold badges 97 97 silver badges 124 124 bronze badges

One thing I find WinSCP does well that I cannot do easily with Ubuntu tools is tunneling to a secondary machine. This is done with one with one connection setting in WinSCP. While I can use the native file browsers in Ubuntu (11.11) to reach any machine, I cannot easily tunnel thru an intermediate machine to reach a third one. I suspect it is because I do not well understand how to set up tunneling. I am toying with gSTM, but there is little documentation, and I suspect it is for setting up local tunnels, not remote ones. In any case it is not as dead simple as WinSCP made it. This is no anwser, but perhaps it highlights a critical feature of WinSCP that suggestions for alternatives should address.

Now off to learn more about tunneling.

One big thing not mentioned is the fact that with WinSCP you can also use key file authentication which I am unable to do successfully with Ubuntu FTP clients. KFTPGrabber is the closest thing I can find that supports key file authentication. but it still doesn't work for me, where WinSCP does.

Use Nautilus, the default file manager in GNOME. Here is how you may - Best SCP GUI on Linux.

Читайте также: