Port forwarding
Froward host port 9022 to guest port 22 in VirtualBox settings:
SSH connect
If you try to connect now you will get following:
ssh dev@localhost -p 9022
ssh_exchange_identification: Connection closed by remote host
You need to install ssh server on guest machine (Ubuntu):
sudo apt-get install openssh-server
After that try connect again (type yes):
ssh dev@localhost -p 9022
The authenticity of host ‘[localhost]:9022 ([127.0.0.1]:9022)’ can’t be established.
ECDSA key fingerprint is SHA256:hHafM4Aoy9TpHEq4ISdsNVhowOp7nocSfK9ER+BoheI.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘[localhost]:9022’ (ECDSA) to the list of known hosts.
dev@localhost’s password:
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.19.0-56-generic x86_64)
* Documentation: https://help.ubuntu.com/
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
dev@dev-box:~$
Done!