ESXi and SSH authorized keys

When using ESXi, after every reboot the authorized keys are lost.

If you add them to the oem.tgz file which gets deployed each reboot, you’re fine:

Copy the existing oem.tgz from the ESXi server:

scp your.esxi.server.ip:/bootbank/oem.tgz .

create a new directory:

mkdir oem

change into that dir:

cd oem

extract the content of current oem.tgz:

tar xvfz ../oem.tgz

add your .ssh/authorized_keys file:

cp ~/.ssh/authorized_keys .

create a new tar file:

tar cvfz ../oem.tgz etc lib sbin usr var .ssh

and finally copy the new oem back to the server:

scp ../oem.tgz your.esxi.server.ip:/bootbank/oem.tgz

Leave a Reply

Your email address will not be published.