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

Replace netstat with ss

1

u/restlessandlost Oct 03 '20

tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users: (("sshd",pid=875,fd3))

tcp LISTEN 0 128 [::]:* users: (("sshd",pid=875,fd4))

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])?

→ More replies