I have dedicated server with esxi.
I added extra user to esxi and added its keys in
Then i rebooted server and that keys folder was gone. Then i find that i need to copy the keys in some persistent storage and then put command in
/etc/rc.local.d/local.sh but i have seen that even that file is rewritten after reboot. so my questions is
- In which file i need to write so that it persist with reboot
- Now i want to disable password authentication. i know i can do that in sshd_config. but i want it to be non permanent. i mean i want to disable it manually and if i reboot then i want it to be reset back to original file with enabled authentication
UPADTE I have setup firewall rules that only my home ip has access to esxi and nothing else. Now so that just in case i am not able to connect and then what i want is to ssh in and disable firewall for sometime and may be change firewall rule for new ip and then re-enable firewall. thats why i wanted ssh access. Few days back i had root account locked because of someone brute forcing. so just in case i want to have extra user which i can ssh into to fix problem. I have enabled ssk key-based authentication but is public. so i want to restrict ssh only to home ip and in case of emergency if my ip changes then i can reboot esxi so that password-based auth work and then i can fix firewall. I am home user so can't afford hardware firewall on esxi.
I have pfsense for internal machines. I don't have any public sites only my labs stuff. I don't want to put esxi behind pfsense because if something is wrong in pfsense then i will be locked out and i will have no way beside re-installing everything