How to allow Shell and SCP access in vCenter 6 Appliance

Few days back. I had installed vCenter 6 appliance and configured it. Today I need to copy Microsoft sysprep files into the vcenter appliance to configure guest customization. But when I tried to connect using winscp client. I got the following error.

vCenterApplianceShellAccess-01

If you click on “Abort” Button then the actual error displayed. Which tells you why there is no access on appliance. Click “OK”

vCenterApplianceShellAccess-02

Solution 1:

This solution does not required any configuration in vCenter Appliance side. From “WinSCP” Client. Choose “SFTP” File protocol from drop down and enter vCenter credentials -> Click “Advanced” Button ->in Advance Site Settings-> Under “Environment -> SFTP -> In “Protocol options” Section -> Enter below command in “SFTP Server” settings.

shell /usr/lib64/ssh/sftp-server

Click “Save” and “Connect” the Client.it should work.

vCenterApplianceShellAccess-03

Without doing above settings. If you try to connect using SFTP .you will get following error.

vCenterApplianceShellAccess-04

Solution 2.

This solution required changes on vCenter appliance Side.

Option 1: From vCenter Appliance:

Using Classic Client:

Here is the 2nd solution of the problem. Access the vCenter appliance using vSphere classic Client.

vCenterApplianceShellAccess-05

Click “F2” and enter the “root user credentials” then again click “F2” to access the Customize System options.

In “System Customization” -> Select “Troubleshooting Mode Options” -> Press “Enter”

vCenterApplianceShellAccess-07

In Troubleshooting Mode options -> Select “Bash Shell” option and Press “enter”.  Optionally you can enable “SSH” as well. Press “ESC twice” to “save” the setting and “exit” from the settings.

vCenterApplianceShellAccess-08

Using Web Client:

You can enable both options SSH and Bash from web client as well.

From Web Client home->Administration->Under Deployment->System Configuration -> Click On “Nodes” -> Click on Node Name “vCenter” -> Under vCenter settings -> Manage -> Settings -> Firewall -> Click “Edit”.

In “Edit Setting” -> Access ->Verify both check box are checked.

vCenterApplianceShellAccess-17

At this stage, if you are not in vCenter appliance console then go their and Press “ALT+F1” to access Appliance Shell. Next enter your “root” credentials and login. Of course you can go back to the vCenter Appliance Main Screen using “ALT+F2”

vCenterApplianceShellAccess-09

Once you logged in. enter “Shell” command to go in bash shell.

vCenterApplianceShellAccess-10

Above command temporarily change the shell. Even at this stage you shell changed at appliance. But you still not able to use winscp client to copy the files at appliance.

To enable the scp access. You have to change the shell by using the below command at bash shell on vCenter appliance.

#chsh –s /bin/bash

vCenterApplianceShellAccess-11

Now try to acces the vCenter appliance using winscp and it should work as shown below.

vCenterApplianceShellAccess-12

By changing the shell using above command.Now every time when you logged it. you will directly login into bash shell.

vCenterApplianceShellAccess-14

If you want to change the shell back to appliance default from bash shell. Use the below command.

#chsh –s /bin/appliancesh

vCenterApplianceShellAccess-15

Option 2: From Shell

If you do not want to enable appliance bash shell from vCenter appliance using vSphere clients as I did in above steps.

Then Either you “SSH” on the appliance using putty, if you have already enabled it or press “ALT+F1” to access the appliance shell directory from appliance.

Run the below commands on vCenter Appliance Shell.

#shell.set –enable True

#Shell

vCenterApplianceShellAccess-16

Advertisements

6 responses to “How to allow Shell and SCP access in vCenter 6 Appliance

  1. Pingback: How to Install Certificates in Vsphere 6.0 / 6.5 appliance – Ops Lounge·

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s