VMware vSphere

 View Only
  • 1.  SSH to VCenter

    Posted Sep 13, 2023 03:12 PM

    I'm having a problem that's baffling me.  I need to write a script to automate gathering certain performance metrics.  I'd like to use ansible for this.  To do so I need to be able to ssh to my vcenter.  I have SSH enabled as a service and I can connect to the SSH port, but my authentication fails.  I get a "Too Many Authentication Failures" error.  If I enable -v with ssh it tells me that I've had some number of attempt failures, perhaps 5, or 8, or 10, and tells me the account is locked.

    Googling has suggested to disable pubkey authentication, but that isn't working for me.  VmWare docs tell me how to enable SSH but not the secret sauce to actually do it. 

    What do I need to know to SSH to VCenter?

     

    Thanks

    -Bob



  • 2.  RE: SSH to VCenter

    Posted Sep 13, 2023 09:45 PM

    Hi Bob

    Once you enable SSH in the vCenter management page, are you able to connect to it with Putty or whatever tool you use? Bypass ansible and scripts for now. We need to determine where the problem is coming from first.

    Are you trying to SSH with username and password or SSH key? If you are using a key, can you try with username and password for the root account ?



  • 3.  RE: SSH to VCenter

    Posted Sep 13, 2023 10:31 PM

    Hi

    My source host is a Mac and I'm running the SSH that's shipped with Monterey, I believe it's a version of openssl.  I am using login ID and Password.

    Regards

    -Bob



  • 4.  RE: SSH to VCenter

    Posted Sep 13, 2023 10:48 PM

    Just to confirm...

    1: You are able to login to the vCenter appliance management page vcenter:5480 as root without any problem?

    2: You are trying to ssh to the same vCenter using the same root account and password?

     



  • 5.  RE: SSH to VCenter

    Posted Sep 15, 2023 06:56 AM

    What about firewall rules? Maybe port 22 is not allowed



  • 6.  RE: SSH to VCenter

    Posted Sep 15, 2023 06:56 AM

    Ooopps missed that. You are able to open the session



  • 7.  RE: SSH to VCenter

    Posted Sep 15, 2023 11:09 PM

    Yes and no.  I don't expect to login to vcenter as root, I have tried it but just to rule it out.  I have tried my username, rlamothe, my username with domain, cf\\rlamothe, and administrator@vsphere.local.  All fail the same way.



  • 8.  RE: SSH to VCenter

    Posted Sep 15, 2023 11:11 PM

    I'd like to use pubkey but it isn't configured and I won't be able to configure it without being ablle to SSH in.



  • 9.  RE: SSH to VCenter

    Broadcom Employee
    Posted Sep 15, 2023 07:42 AM

    Few things to identify :

    - Are you able to login to vCenter appliance via any SSH tool with username root. (If this is not working then nothing will work)

    - If root user is locked then it needs to be reset.

    https://kb.vmware.com/s/article/2147144

    pam_tally2 -–user=root

    pam_tally2 -–user=root --reset