
Your status info about the sshd daemon shows running, however no listening port is associated with it (or doesn't seem to).įurther, as you were told in the comments, your sshd_config file seem to be incorrect. Your netstat output shows that there's no process listening to port 22, and that would explain why you get a Connection refused when trying to SSH. Kindly guide me where I am missing the part? How can I get it connected? Now again I tried ssh but again got the error. Unix 3 STREAM CONNECTED 17225 /var/run/NetworkManager/private Unix 3 STREAM CONNECTED 17221 /var/run/NetworkManager/private Unix 3 STREAM CONNECTED 17722 3 STREAM CONNECTED 13422 # Generated by iptables-save v1.4.21 on Wed Sep 23 18:50:34 2015Īs per comment checked netstat -an | grep 22 I though my iptables might be preventing it so configured it as : vim iptables-save > iptables iptables -t nat iptables -t nat iptables -t mangle iptables -t mangle iptables -P INPUT iptables -P FORWARD iptables -P OUTPUT iptables-save > /root/lesĪnd I queried the iptables-save # Generated by iptables-save v1.4.21 on Wed Sep 23 18:50:34 2015 Now again tried to connect ssh via ´ssh not I got connect to host localhost port 22: Connection refused #Privilege Separation is turned on for security UsePrivilegeSeparation yes # HostKeys for protocol version 2 HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key HostKey /etc/ssh/ssh_host_ecdsa_key HostKey /etc/ssh/ssh_host_ed25519_key #Use these options to restrict which interfaces/protocols sshd will bind to My sshd_config as follows : What ports, IPs and protocols we listen for Port 22 Vi /etc/ssh/sshd_config and added command to deny root login :
#Ssh connect to host refused password#
Now I tried to connect ssh which requires password so what I did was Reconfigured dpkg-reconfigure openssh-server and it also lead to success Loaded: loaded (/lib/systemd/system/ssh.service enabled)Īctive: active (running) since Wed 17:20:36 IST 36min ago
#Ssh connect to host refused install#
What I have tried/did: `apt-get install openssh-server` I was trying to connect ssh in debian, I am using kali 2.0 sana SSH: connect to host localhost port 22: Connection refused In debian kali I tried to connect ssh and getting the following error :
