Dev Notes Dev Notes
  • Home
  • Categories
  • Tags
  • Archives

How to access Ubuntu via SSH in Virtual?

Docker with cron_

Port forwarding

Froward host port 9022 to guest port 22 in VirtualBox settings:

Virtualbox settings

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!


Published

Mar 17, 2016

Last Updated

Mar 17, 2016

Category

HowTo

Tags

  • ssh 1
  • termianl 1
  • ubuntu 2
  • virtualbox 1

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor