When logging into the new VCSA 6.0 via SSH, you will notice that you are no longer dropped into a normal bash shell but into a new appliancesh (pronounced appliance shell) environment. This new interface provides basic set of virtual appliance management capabilities including Ruby vSphere Console (RVC) access which makes the majority of operations convenient to a vSphere Administrator but it also helps restrict unnecessary access to the underlying filesystem which can be helpful from a security standpoint.
If you need to access the underlying filesystem, you can temporarily enable it by running the following two commands:
shell.set --enabled True
If you need to transfer files to/from the VCSA via SCP/WinSCP, you will need to change the default shell from /bin/appliancesh to /bin/bash else the operation will fail. You can easily do this by using the chsh command:
chsh -s "/bin/bash" root
If you rather have the BASH shell configured as the default after deployment and not have to go through this manual process each time, you can actually configured using the following hidden option called guestinfo.cis.appliance.root.shell
This property allows you to specify the default shell for the "root" account and you can only modify this if you deploy the VCSA using ovftool. Here is the parameter you would append to the ovftool argument list:
You can leverage this new property and automate the deployment of the new VCSA 6.0 and for more details be sure to check out my VCSA 6.0 Automation Series.
Thanks for the tip. File copy is required sooner or later in most production environments.
Thanks for the info, I have deployed vcenter 6.0 using the vcsa deployment tool and JSON configuration file as part of an automated installation. But setting the default command prompt to bash is a manual step I would like to avoid... Is there any way this can be configured in PowerCLI and or as part of the JSON file?
Despite enabling bash, I simply get "-bash: shell.set: command not found". Dumbfounded! Help much appreciated.
Brian Simon says
Same error for me as well.
Thanks for this great share (as usual :)) Any idea of how we can integrate that to the JSON config file for automated deployment?
Also, is there any way of running scripts/command remotely to the VCSA (either via putty or plink) to move to the /bin/bash?
I need to run some commands remotely (change timezone, add to an AD domain etc)
William Lam says
This particular configuration is not part of the JSON. if you need to make some configuration changes, you can do so using appliancesh command which can be automated. Have a look at this article http://www.virtuallyghetto.com/2016/02/how-to-remotely-run-appliancesh-other-shell-commands-on-vcsa-wo-requiring-ssh.html which does not rely on SSH or having default shell change
Thanks for the reply. I'll and give you some news 🙂
"and you can only modify this if you deploy the VCSA using ovftool"
i have automated installation without ovftool. there is anpther way to modify "guestinfo.cis.appliance.root.shell"?
William Lam says
Well, the other option is to basically add it as a VM Advanced Setting using the vSphere API (do this prior to powering on the VM) and you'll get the same result
James m says
The chsh command asks fixes authentication errors when using plink.exe so thanks for that.