Winscp подключение к виртуальной машине
I installed Ubuntu13_desktop in VMware(VMware® Workstation 7.1.6) based with Windows 7. Now I want to connect to Ubuntu from Windows 7. Set the WMware as Host-only. Installed WinSCP in Windows, configured
Clicked Login, it showed
I can succeed to ping Ubuntu by cmd.
Can anyone help me to let me access Ubuntu by WinSCP? Thanks in advance.
Assumptions
I assume you have one (or more) Ubuntu Linux virtual guests installed as per my instructions for setting up a virtual network. Of particular importance, Port Forwarding has been enabled in VirtualBox (see towards bottom of step 4), forwarding a host port (e.g. 2201) to the guest port 22. This means that when an application on the host connects to port 2201 (and destination address localhost or 127.0.0.1 ), VirtualBox will forward the original application traffic to port 22 on the corresponding guest. Recall port 22 is for a SSH server (which should already be installed on each virtual machine as "OpenSSH server" was selecting during the install).
Connection to ESXi
Connecting to ESXi with ESXi 6.0 and ESXi 6.5 is pretty much default.
You don’t need to change any of the default variables, it should connect right away
Connecting to ESXi 5.X and prior will require you specify SCP in place of SFTP in the connection dialog.
About: John Borhek
John Borhek is the CEO and Lead Solutions Architect at VMsources Group Inc. John has soup-to-nuts experience in Mission Critical Infrastructure, specializing in hyper-convergence and Cloud Computing, engaging with organizations all over the United States and throughout the Americas.
for VCSA 6.5:
Choose the Environment/SFTP option
Specify for SFTP server: shell /usr/libexec/sftp-server
3 Answers 3
Well the port 22 is for SSH service. So you can probably try installing openssh-server in your ubuntu by typing
sudo apt-get install openssh-server
and then try connecting with the following details:
hostname: [IP Address of the computer]
Hopefully this should work.
Hello, thanks for you advise. I did sudo apt-get install openssh-server . But it still doesn't make sense. Now, I installed FileZilla in Windows, it prompted Status: Connecting to 10.112.20.229. Response: fzSftp started Command: open "oracle@10.112.20.229" 22 Error: Network error: Connection refused Error: Could not connect to server
And the problem became more serious. By WinSCP, it prompts The server rejected SFTP connection, but it listens for FTP connections. Did you want to use FTP protocol instead of SFTP? Prefer using encryption.
First look at auth.log on the system.
In my case with WinSCP, I found something like this:
And comment the line in /etc/ssh/sshd_config :
don't forget to restart ssh :-) Hope this can help some one.
Thank you, this workaround worked for me, but it would be good if somebody can elaborte on the security implications of this,
If sshd (openssh-server) is installed and running, but still no access when using WinSCP. In Ubuntu 16.x look at the auth logs:
The problem is Ubuntu sshd configuration defaults to public/private key authentication for remote ssh access:
If you want to skip the kay-pair work, Open the sshd conf file:
Find the above attributes and modify to:
If you have set up a user on the Ubuntu 16.x instance, you now should be able to ssh or WinSCP with username/password. Please be aware that the security of the system is now at greater risk.
Install WInSCP with a Commander Interface
33 thoughts on “Using WinSCP with the VMware vCenter Server Appliance”
Thank you for putting this post together, John! I was stuck trying to get SCP to work with the VCSA in 6.5, and your post help me get through it with ease! Thank you!
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 8 years ago .
I'm a newbie in working with remote servers and in working with FreeBSD. I want to connect to the FreeBSD running on a virtual machine on my Windows 7 in order to be able to see the files with an explorer interface and be able to copy/paste files to and from it.
I have done this before a while ago using WinSCP but that time it took me 3 days to figure out the configurations I need to make the connection and unfortunately I can't remember them now and do not have another 3 days to waste!!
In my active networks I see to VMware Network adaptors (VMware is the virtual machine I am using) which have the IPv4s: 192.168.134.1 and 192.168.80.1 and when I run "ifconfig" on my virtual FreeBSD there is no IP address (except inet 127.0.0.1). The hostname of FreeBSD is "FreeBSD1" .
WinSCP requires me to fill in a file protocol which I think should be FTP **(correct me if I'm wrong; the other options are SFTP and SCP), a port number (which it sets to 21 by default for FTP) a hostname which I have tried "FreeBSD1", "192.168.134.1" and "192.168.80.1" with my username(root) and password.
When I use the hostname "FreeBSD1" I get the error:
"The requested name is valid, but no data of the requested type was found. Connection failed."
and for the other two I get:
"No connection could be made because the target machine actively refused it. Connection failed."
The only thing is, as far as I remember, last time I tried (and succeeded after 3 days) "ifconfig" would show an IP which I think I used as hostname.
** For FTP it also requires an encryption which I set to no encryption. The other options are "SSL/TLS Implicit", "SSL Explicit" and "TLS Explicit".
Используйте WinSCP для передачи файлов между VirtualBox и Windows
В первый раз я написал блоги. Завершение заданий Linux относительно небольшая, но для передачи файлов под двумя операционными системами я провел весь день. Хотя Baidu вводит использование WinSCP, это очень просто (не достаточно подробно), но когда я его использую, у меня действительно есть проблема, почти сталкивайтесь с всеми проблемами, которые могут быть встречены, теперь поделитесь ею, надеюсь, помогите в более поздние люди. Потому что профессиональные знания не сильны, я попрошу Хайли.
Прежде всего моя виртуальная коробка - 16.04.4, Windows Win10 Win10. Ниже я подробно объясню шаги подключения.
1. Просмотрите IP-адрес виртуальной машины.
Здесь возьмите немного больше, Linux View The Command IP-адреса является ifconfig -a (и ipconfig немного отличается) в третьей строке, 172.20.10.2 - IP-адрес виртуальной машины.
2. Просмотр IP-адреса хоста
Введите IPConfig под DOS, чтобы найти адрес IPv4 в «беспроводном локальном пространственном адаптере WLAN», который является IP-адресом нашего хоста.
3. Обе стороны пинг друг друга, посмотрите, если пинг
(1) Хост виртуальной машины Ping такой.
(2), в случае Ping, пожалуйста, проверьте брандмауэр хоста (Windows)
1) Откройте «Сеть и Интернет» в настройках
2) Найти брандмауэр Windows на правой стороне
3) Найти вторую строку «Расширенные настройки»
4) Нажмите на левую «входящие правила», чтобы найти «файлы и совместное использование принтера» (ECHO запрос - ECMPV4-LN) «два
Нажмите Включить правила
На этот раз ваша виртуальная машина должна иметь возможность пингировать хост (должно быть, потому что Windows отказывается быть пингом), чтобы обеспечить безопасность по умолчанию.
5) Пинг под виртуальной машиной Windows Ping
Это корректно правильно
Если Ping не проходит, Smart, вы, должно быть, получили верхнюю часть выше, верно, мы должны отключить брандмауэр виртуальной машины
Используйте команду $ sudo Ufw, чтобы отключить брандмауэр
В это время вы должны пинговать виртуальную машину на хосте.
4. Начните использовать WinSCP
После серии готовности мы можем формально использовать сегодняшний главный герой Winscp.
Это открыло это
Первый раз, не лево на имя хоста, то есть есть только один «новый сайт», нажмите на новый сайт.
(1) Сначала измените протокол файла к SCP, а затем напишите номер порта IP-адресов виртуальной машины, используя по умолчанию 22
Имя пользователя записывает имя пользователя вашего входа в систему Virtual Machine, пароль также является паролем для ввода виртуальной машины.
(2) Нажмите Сохранить, нажмите на нижний логин. Если вы успешно успешно, это действительно слишком повезло. Если у вас есть неправильный доступ, проверьте 22-й порт виртуальной машины.
Способ открытия 22-го порта - ввести команду под виртуальной машиной:
$sudo apt_get install openssh-sever
Теперь попробуйте посмотреть, сможете ли вы войти в успех?
После того, как логин успешен, вы можете увидеть интерфейс. В это время вы можете легко перетащить файл под виртуальную машину в Windows и легко перетаскивать файлы под Windows на виртуальную машину.
Previously I described how to setup a virtual network amongst several Linux virtual machines using VirtualBox. VirtualBox provides terminal access to those virtual machines via its own GUI. However I find the VirtualBox GUI is sometimes a bit slow and not as convenient as other terminals (e.g. Gnome Terminal on Ubuntu). In this article I describe some alternatives for connecting to your virtual machines. The include:
Copying Files Between Host and Guest using WinSCP (Windows only)
WinSCP is a free, open source Windows application that provides a GUI to transfer files to/from a SSH server, i.e. between host and guest. Download, install and the connect to the server as below:
Connect to SSH server on guest with WinSCP
Copying Files Between Host and Guest using Command Line (Windows: PuTTY)
In Windows, you can use pscp.exe (which is included with PuTTY) in a similar manner to scp (see above). If you expect to use it in a regular basis, then set the path. Instructions for setting the path in Windows, and for using pscp.exe are given in the PuTTY manual.
See below if you'd prefer to use a GUI in Windows, instead of the command line.
Exploring and Sharing Files on the Virtual Machine (Linux only)
In Linux and OSX you can use scp in the Terminal to copies files to/from the guest. PuTTY in Windows also supports command line based file copying with pscp . Another alternative is to use WinSCP to copy files in Windows. However it would be nicer to be able to view and copy files using the standard file explorer on the host. The following describes how to do this in Ubuntu Linux using the standard file explorer called Nautilus (it should be similar with other Linux distributions and file explorers). The alternative techniques - scp, pscp and WinSCP - are described later.
In Ubuntu Linux (on the host computer) you can also use Nautilus, the default file explorer, to connect to the SSH server on the virtual machine.
From the File menu, select Connect to server . . Change the Type to SSH and then set the following:
Once connected you can manage files on the virtual machine, including copy-and-paste to/from your host machine using the GUI provided by Nautilus.
Example of Nautilus for viewing folders on a virtual machine
Connecting to VCSA with WinSCP
If you try to connect to the VCSA with WinSCP in a default configuration, you will get the following message:
Received too large …. SFTP Packet ….. Cannot initialize SFTP protocol. Is the host running an SFTP server?
This occurs because the default shell for the VCSA 6.5 is not bash.
VMware KB 2107727 recommends changing the shell that the entire VCSA uses from /bin/appliancesh to /bin/bash prior to using WInSCP, then changing it back when you are done! This is a ridiculous waste of time and unnecessary re-configuration of the VCSA.
It is much more expedient just to reconfigure WinSCP and leave the VCSA the way it is! In order to use WinSCP, you will need to change where WinSCP looks for the sftp-server binaries.
In the new connection dialog, specify the Host name, User name and then click the Advanced button
The settings for VCSA 6.5 and VCSA 6.0 differ slightly so
Using the Host Web Browser to Access a Guest Web Server
The default setup of the virtual network uses only terminal access on the guests. There is no GUI or window manager on the guests. That makes using a web browser on a guest difficult: you are restricted to a terminal based text browser like Lynx. If you want to run a full web browser, like Firefox, on a guest then a full desktop environment needs to be installed on that guest. This takes up a lot of disk space and may also require more RAM for the guest. An alternative is to use the web browser on your host to access the web servers on your guests. It involves SOCKS tunnelling. Lets go straight into how to do it, with an explanation of how it works later.
On your host, connect to the guest using SSH and a special tunnelling option. With ssh on the command line in Linux/OSX, this is performed using the -N and -D options:
After entering the password there will be no visual response - leave this terminal open.
Now in your web browser preferences/settings, you need to enable proxying specifically using SOCKS. In Ubuntu Firefox, go to Edit menu and select Preferences . From the Advanced icon select the Network tab and press the Settings button. This lets you to set a proxy. Choose Manual proxy configuration and set the SOCKS Host to localhost and the Port to 3333 (or whatever you selected when starting ssh with the -ND option). It should look similar to the following:
Firefox proxy settings to tunnel to virtual guest
Now your host web browser will connect to the SSH client on the host, which in turn is connected to the SSH server on the guest. All of your host web browser traffic will go via the guest. In your web browser address bar, type in the IP address of the guest, e.g. 192.168.1.1 . You should see the web page offered by that guests web server.
This should work with most host operating systems and browsers, so long as the browser supports SOCKS proxies. If using Windows, since ssh is not available on the command line, you need to use PuTTY. Some instructions on using PuTTY for the SOCKS tunnelling are here.
From time to time, you will find it necessary to transfer files to or from your VMware vCenter Server Appliance (VCSA) or ESXi Servers. If you are working from a Windows desktop or server, there’s no more convenient utility than WinSCP for copying files securely between Windows and Linux Systems.
There are a few issues, however, when it comes to connecting to the VCSA with WinSCP that I will show you how to work around without reconfiguring the default shell of your VCSA!
for VCSA 6.0:
Choose the Environment/SFTP option
Specify for SFTP server: shell /usr/lib64/ssh/sftp-server
And then save the settings (which include the SFTP server)
Now you should be able to login:
Accept the host key
Click: Never show this banner again
Enter the password for root
As soon as you connect, you will be in the root user folder which should be empty.
Navigate up one level in the right-hand pane of the interface
When you are at the root of the filesystem, you will see this:
And you can access any other folders from there, for example: /var/log
Getting WinSCP
Accessing Virtual Machine using SSH via a Terminal
Open up a terminal in your host system. This is usually the application called Terminal in Linux or OSX; start PuTTY if in Windows.
Now connect using the SSH client to localhost and port 2201 (or whichever you choose in Port Forwarding). On the command line that is performed using the -p option. The -l option may also be used to specific the username for the guest login:
In Windows using PuTTY when connecting make sure you set the Host Name to localhost and change the Port to 2201. It looks similar to this:
Create session in PuTTY to connect to virtual guest SSH server
Once connected you are now accessing the virtual guest.
Copying Files Between Host and Guest using Command Line (Linux, OSX)
If you can't or don't want to use the file explorer in your host to copy files, then you can use the command line. On most Linux/Unix systems (including OSX), scp can be used in a terminal on the host. The general format is to specified the source and destination, where one of them (depending which direction you are copying) includes the remote address.
To copy a file example.txt in your current directory on the host to the guest use the following. Note that you indicate the port using the -P option and the guest username is given before the @ character.
And to copy a file index.html in the users tmp diretory on the guest to the host:
Читайте также: