vCenter ssh key based password less authentication configuration is not working and promting for the password
VMware vCenter Server 7.x
VMware vCenter Server 8.x
If the vCenter appliance shell is configured as the default shell (/bin/appliancesh) for root, the key based authentication will still ask for the password.
ssh root@<vCenter_IP_Address> -v will show a successful authentication. However, it will still ask for the password
VMware vCenter Server 8.0.2.00400
Type: vCenter Server with an embedded Platform Services Controller
debug1: Authentications that can continue: publickey,password,keyboard-interactivedebug1: Next authentication method: publickeydebug1: Offering public key: C:\\Users\\Administrator/.ssh/id_rsa RSA SHA256:/<id>debug1: Server accepts key: C:\\Users\\Administrator/.ssh/id_rsa RSA SHA256:/<id>debug1: Authentication succeeded (publickey).Authenticated to #.#.#.# ([#.#.#.# ]:22).debug1: channel 0: new [client-session]debug1: Requesting [email protected]debug1: Entering interactive session.debug1: pledge: networkdebug1: ENABLE_VIRTUAL_TERMINAL_INPUT is supported. Reading the VTSequence from consoledebug1: ENABLE_VIRTUAL_TERMINAL_PROCESSING is supported. Console supports the ansi parsingdebug1: client_input_global_request: rtype [email protected] want_reply 0debug1: Remote: /root/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwardingdebug1: Remote: /root/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwardingLast login: dd/mm/yy from #.#.#.#Password:
User need to change the default shell to /bin/bash by running the below command for the key based authentication to login without password.
chsh -s /bin/bash root
To enable password less authentication in the VCSA, the shell needs to be set to bash shell as the Appliance Shell is a controlled environment designed to execute only specific VCSA commands and utilities.