While installing hadoop in my local machine , i got following error
ssh -vvv localhost 
OpenSSH_5.5p1, OpenSSL 1.0.0e-fips 6 Sep 2011 
debug1: Reading configura         
        If you restart service then it will work
$ service sshd restart
then check
$ ssh localhost
It will work
sudo systemctl status sshd
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor prese>
   Active: inactive (dead)
     Docs: man:sshd(8)
           man:sshd_config(5)
sudo systemctl enable sshd
sudo systemctl start sshd
I used:
sudo service ssh start
Then:
ssh localhost
If you still face problems, try the following:
sudo ufw enable    
sudo apt-get install openssh-server
This might work too.
If install Hadoop on Mac OSX, make sure turn on Remote Login under System Preferences then File Sharing. This worked on my machine.

My port number is different. i tried using
ssh localhost -p 8088
this worked for me