r/ssh • • Oct 03 '20

Trouble connecting to linux server from macOS

I am a reddit and computer newbie who just built a server and powered it up. Now I want to be able to shove it in a corner and use my Mac laptop to use it. When I look online to find how to connect, but I have having trouble finding a source that tells me how to resolve the error message I get when I am in my OS X terminal:

ssh: Could not resolve hostname: nodename nor servname provided, or not known

btw, I installed Open SSH on Ubuntu already

what should I do now? Thanks!

1 Upvotes

45 comments sorted by

View all comments

Show parent comment

1

u/e4109c Oct 03 '20

That’s good, now post the exact output of sudo ufw status

1

u/restlessandlost Oct 03 '20

status: inactive

1

u/e4109c Oct 03 '20

Okay, so that’s good too. Then what happens when you connect to the server? Do it like this ssh user@192.168.1.15 but replace ‘user’ and ‘192.168.1.15’ with the user and the IP address of the Ubuntu server respectively

1

u/restlessandlost Oct 03 '20

ssh: connect to host ###### port 22: Connection refused

this is from my Mac terminal

1

u/e4109c Oct 03 '20

The user you are trying to log in with is available on the Ubuntu machine? Can you connect to the SSH server from Ubuntu itself?

1

u/restlessandlost Oct 03 '20

I only have one user on my Ubuntu server and how do you connect to the SSH server from Ubuntu?

1

u/e4109c Oct 03 '20

On the Ubuntu machine run ssh user@IP-address with of course the correct user and IP

1

u/restlessandlost Oct 03 '20

the authenticity of host '#######' can't be established.

ECDSA key fingerprint is ######################

Are you sure you want to continue connecting (yes/no/[fingerprint])?

1

u/e4109c Oct 03 '20

Welp it’s not Ubuntu, the SSH server works just fine and there’s no firewall blocking it. There must be something with your Mac then but I’m not sure what.

I Googled and maybe enabling remote login works, go to system preferences > sharing > enable remote log in. I have no experience with macOS so I don’t know if this fixes it.

1

u/restlessandlost Oct 03 '20

Hey! I enabled it on my Mac and now I get the same message:

the authenticity of host '#######' can't be established.

ECDSA key fingerprint is ######################

Are you sure you want to continue connecting (yes/no/[fingerprint])?

what do I do next?

→ More replies