VMware Cloud Community
sunnychau
Contributor
Contributor

enable ssh from vSphere Client cli

Is there any way to enable ssh (Start and stop with host) from command line remotely.

ie: snmp - can use vicfg-snmp.pl, how about ssh service ?

GUI way:

vSphere Client > Security Profile > Services section > SSH > Start and stop with host

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership

Something like this

Get-VMHost -Name $esxName | Get-VMHostService |

        where {$_.Key -eq "TSM-SSH"} |

        Start-VMHostService -Confirm:$false

For a permanent solution have a look at Alan's post called PowerCLI: Technical Support Mode


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
kunaludapi
Expert
Expert

I am using vmware vsphere cli version 5.5

To check the status of service

esxcli.exe -s esxihost -u root -p password network firewall ruleset list -r

To change enabled state t =true and f= false in the last.

esxcli.exe -s esxihost -u root -p password network firewall ruleset set -r sshServer -e t

Regards,

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
Reply
0 Kudos
LucD
Leadership
Leadership

Afaik that only opens the firewall for SSH


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
bhards4
Hot Shot
Hot Shot

Hi,

There is a great article written by Williams for starting and stopping the ssh services remotely.

Follow below link for more details.

hostServiceManagement.pl

Regards,

Sachin

Reply
0 Kudos