I was trying to connect to localhost machine via SSH but was not able to do so on my Ubuntu box. That is because SSH server needs to be installed and running on port 22.
You can do so by executing the following command on Ubuntu:
sudo apt-get install openssh-server
You can then check it’s status:
gaurav@asgard:~$ service ssh status
ssh start/running, process 541
Login