Using WinSCP with the VMware vCenter Server Appliance
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!
Getting WinSCP
Browse to: https://winscp.net to download the WinSCP Installation Package
Install WInSCP with a Commander Interface
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
for VCSA 6.5 and VCSA 8.X:
Choose the Environment/SFTP option
Specify for SFTP server: shell /usr/libexec/sftp-server
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
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.
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!
This is amazing. Worked perfectly thank you!!!
Terrific tip, thanks!
Thank you! works perfect.
bravo, much better solution than the KB
Thanks!Simple is better!
Not quite sure what you are getting at here?
Thanks for the write up, exactly what I needed to get connected!!
Many thanks for the guide. Fixed the frustrating issue for me.
I couldn’t get it to work for me. The technician ended up doing something different on the server.
https://vCenter Server FQDN or IP/appliance/support-bundle which allowed brought up a window, allowed me to authenticate, and then grab the files he needed. Obviously this only works with support files, but still.
Great Tip! Worked well! Thanks
Thanks so much .. really thanks a lot
i had been banging my head for an hour on this !! This was perfect
Great thanks!!
Thanks so much .. really thanks a lot
You are Welcome!
This is so much more helpful than the lame answer given by VMWARE’s own indian helper.
Thanks! That’s why I started this. I wish I had more time for blogging!
Hi John,
I was trying to connect ESXi using WinSCP but get the message “access denied”. I setup a root password on ESXi but it didn’t work out…
What may be the reason for that?
Thanks
Vlad
You will need to enable SSH in the ESXi Host.
Thank you for this!
You are welcome Bob.
its working.
Thanks a lot.
Thank you bro you are awesome!!
Thank you John for this fantastic tutorial.
Thanks!
Thank you very much for this after throwing away a chunk of the afternoon trying to transfer one file. Can confirm the 6.5 instructions work with 7.0.
Awesome stuff. Thanks!
You might consider say to TYPE the SFTP server protocol options as opposed to SPECIFY. (shell /usr/libexec/sftp-server) I thought it was in a dropdown and not requiring my manual entry. Took a few minutes to sort that out.
Quick fix thanks to you!
Hi.
Has anyone figured out how to change the Shell=default to the one in this article via winscp.exe command line?
Thanks,
MA
Its really work. Thank You sir!
this is what the internet was made for. thank you, mate!
Thanks! It’s funny how you know more than the guys who wrote the software. I often feel like VMware got in over their heads trying to create this vCenter Server Appliance.
Works with vCenter 7.0.2, too. Thank you.
Awesome, Can confirm the 6.5 instructions work with 7.0, Thank you very much!
Yes, I can. Thanks.