Go to Network Section for the Guest & create a new Port Forward from guest port 22 to host port 22022 (or whatever port you have free) Save & start up the VM Open terminal and ssh to your local forwarded port
I’ve only just discovered you can have wildcards in your hosts in ssh_config, ie Host db* User dbman Host www* User wwwadmin
Put this at the bottom of your ~/.bashrc if [ ! -f /tmp/.sshauthsock ]; then eval $(ssh-agent -s) echo “export SSH_AUTH_SOCK=$SSH_AUTH_SOCK” > /tmp/.sshauthsock else source /tmp/.sshauthsock fi
Using this ubuntu guide with 2 changes. 1. Change the configure line to ./configure –libexecdir=/lib/x86_64-linux-gnu/security/ –with-mantype=man 2. Instead of editing the sudoers file, create a file under sudoers.d (more modular): echo “Defaults env_keep += SSH_AUTH_SOCK” > /etc/sudoers.d/ssh_auth Also note that the latest version of this module on sourceforge is more recent than linked.
sudo /usr/sbin/sshd -t via OpenSSH Tip: Check Syntax Errors before Restarting Server.
The #1 reason you should replace ssh with mosh, if your environment permits: “With Mosh, you can put your laptop to sleep and wake it up later, keeping your connection intact. If your Internet connection drops, Mosh will warn you — but the connection resumes when network service comes back.” via Mosh: the mobile shell.