Search This Blog

Thursday, April 6, 2023

Create Vcenter SSH Public Key

 To use SSH public key on vcenter, you need to perform this steps:

1. Create Key using puttygen (download putty to use this tool)

a) click on generate

b) move your mouse cursor to generate

c) Save the public key
d) Save the private key

2. Use putty to SSH into vcenter
To enable and start the Bash shell, type
> shell.set --enabled True
> shell

3. Edit authorized_keys
> sudo vi ~/.ssh/authorized_keys

a) Insert the public key. Example that you have created
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCw7K7657C3KVD8uEtuBxvEjPui4lD+xZqw0+k95mCH19/xOEWhY6UJREPVRTIw8sgIa2PvlUjuCh+m7ZUqHdheChFE55qxjvZLhGJrAU2MvpAv6ltL5ePUYo1iQYRD/PdMMJKY9EcOE7MOBFkSKKI9IYnLyGr3+6QDfSbeuLc42qNcxUQVTPhRAn6gbxj3ISTxOrf1PdwixbM5GGlyIPmYxzcRX91QFVuhsPfXPdOeWczm+0cBkqIPraRjBwmu3B5dTZz12EFQtQbZxc6fpxhyj0eIMsu8bFjk49IZkat1hLdP00unYOfyTrkAnF5XdtglNcw40ot5MwW4mRCKfGCZ rsa-key-20230406
b) save it and exit

4. To activate key authentication, you have to make sure /etc/ssh/sshd_config: has the following line

PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys