Author Options:

"Port 22: Connection refused" using "ssh" remote access on Mac OS X ? Answered

I'm using Mac OS X 10.6.4, along with a couple of other people on the same network.
I have a firewall set up on my computer
While I am able to connect to most people remotely, using the command (in terminal)
ssh [username]@[IP address]
(I get the IP address by pinging the computer name)
There are a couple of people where I come across the message of:
"Port 22: Connection refused"   (or something along those lines)
Anyone know what's happening? Cos I'm clueless.....
I've tried to see if removing the known hosts files changes anything, but it doesn't.
I have no idea as to whether those people have firewalls set up or something
Is there another port that could be used here or something (23 maybe..? I heard...?)



8 years ago

Check your .ssh/config file, and talk to the other people. Do they have port 22 disabled on their machine (a good security practice if you're not a server)? Do they have their system set up for Kerberos authentication?


Answer 8 years ago

There's only a "known_hosts" file in the .ssh folder,
The majority have port 22 enabled, although terminal is disabled by default. Is there a convenient way to check without having to activate a root account, etc etc?


8 years ago

If you are trying to connect to a Mac, the sshd (the ssh daemon or server) is not enabled by default. Enable it by going to the Sharing icon, under System Preferences - Internet and Networking. Enable by checking Remote Login...

As kelseymh suggests, the incoming port 22 is required to be open in any firewall settings.

Port 23 is usually used for Telnet, not a secure shell. Again to use such a port, the server computer requires to listen to the port by running either a modified sshd or a telnet server.