SSH server listening on 0.0.0.0:22?
Matthew Harrington
I have two machines in my home network and I want to connect them over SSH. The first machine has a local ip 192.168.1.23 and openssh remote client installed. The second has a local ip 192.168.1.169 and openssh server installed.
I start the service in the second machine,
sudo systemctl start sshand then I go to the client machine and fail to connect with,
ssh myusername@192.168.1.169:22
ssh: Could not resolve hostname 0.0.0.0:22: Name or service not knownAfter the above failure I went back to the server machine and checked out the ssh service status which says that the server is listening on 0.0.0.0:22.
- Is that (0.0.0.0:22) ok?
- How can I establish that connection over SSH?
- Are
sshandsshdthe same service?
1 Answer
SSH is a protocol for secure communication over an insecure network while sshd provides a daemon which responds to incoming SSH requests.
When you specify a port in ssh use the -p flag. So, for example:
ssh -p22 user@ipaddress NOT
ssh user@ipaddress:22Your IP address would be something like 192.168.x.x not 0.0.0.0 As @steeldriver pointed out in the comments, "0.0.0.0 is just shorthand for 'all IPv4 interfaces'. It's not a real address that you should use in a ssh command".