4

Recently, I signed new keys to gain access to my friend's server. The keys were signed on my friend's machine and I signed and added them to my .ssh folder. I attempted to sign in multiple times but I received an error:

Permission denied (publickey)

This prompted me to try adding multiple keys into my .ssh folder for access to my friend's device. I could get nothing to work.

I then generated a key pair from my own machine, and I handed it to my friend to add to their server. Soon, I was able to SSH into the server.

However, the next day, I am receiving an error:

I'm running MacOS Mojave 10.14.6 on my macbook pro.

ssh: connect to host [hostname] port 22: Connection refused

I tried uninstalling and reinstalling OpenSSH via Brew, but there was no improvement. Additionally, I tried SSHing over port 2222, which also failed.

Additionally, I tried accessing two different servers and my SSH request failed on both attempts, so it seems a client side issue.

I'm rather new to working in the terminal over mac, so any and all advice would be appreciated. Below is the verbose error log.

ssh -vvv [user]@utdallas.edu

OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019
debug1: Reading configuration data /usr/local/etc/ssh/ssh_config
debug2: resolving "utdallas.edu" port 22
debug2: ssh_connect_direct
debug1: Connecting to utdallas.edu [10.182.71.70] port 22.
debug1: connect to address 10.182.71.70 port 22: Connection refused
ssh: connect to host utdallas.edu port 22: Connection refused

Currently, I am receiving a different error, and both seem to be related.

ssh -vvv [email protected]

OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019
debug1: Reading configuration data /usr/local/etc/ssh/ssh_config
debug2: resolve_canonicalize: hostname 67.207.91.101 is address
debug2: ssh_connect_direct
debug1: Connecting to 67.207.91.101 [67.207.91.101] port 22.
debug1: connect to address 67.207.91.101 port 22: Operation timed out
ssh: connect to host 67.207.91.101 port 22: Operation timed out

Both servers which I've tried to SSH into are running some form of linux. (I don't have current My friend is still able to access their server from their account, and the school server which I'm attempting to access also allows SSH for other users. Both ports 22 are open on the machines.

Any diagnostic advice or recommendations for my issue?

Update: I rebooted my Mac, and I ran ssh -vvv [user]@utdallas.edu The first time I tried it it said:

OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019
debug1: Reading configuration data /usr/local/etc/ssh/ssh_config
debug2: resolving "utdallas.edu" port 22
ssh: Could not resolve hostname utdallas.edu: nodename nor servname provided, or not known

I ran it again and got a different error. All subsequent errors are of this form.

OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019
debug1: Reading configuration data /usr/local/etc/ssh/ssh_config
debug2: resolving "utdallas.edu" port 22
debug2: ssh_connect_direct
debug1: Connecting to utdallas.edu [10.182.71.70] port 22.
debug1: connect to address 10.182.71.70 port 22: Connection refused
ssh: connect to host utdallas.edu port 22: Connection refused
8
  • 1. Please add your system version, the destination system and version and more verbosity (ssh -vvv ...)! 2. "SSH was problematic, but I soon fixed the issue.": What was the problem & how did you fix it?
    – klanomath
    Commented Jan 16, 2020 at 22:44
  • Also, we can’t guess what os your server is and what os your client is. An edit to add details will certainly help us help you. It’s not even tagged macOS so we don’t know if you are coming or going but assume it’s macOS.
    – bmike
    Commented Jan 16, 2020 at 22:46
  • thank you, I am editing my post now. Commented Jan 16, 2020 at 23:51
  • Did you reboot your router/modem and your Mac yet?
    – nohillside
    Commented Jan 17, 2020 at 6:13
  • I just rebooted my mac and ran ssh -vvv [host]@utdallas two times. I'm updating the original post with the details. Commented Jan 17, 2020 at 19:43

1 Answer 1

2

I found the solution to my issue. I was attempting to connect with the wrong hostname.

Bottom line: Double, no, triple check the hostname you're connecting to. A lot of these types of issues is caused by innocent, simple mistakes such as this.

1
  • 4
    Don't be embarrassed by this. When I tell you that we've all done it, I wholeheartedly mean every single one of us and spent days troubleshooting only to find out we were typing the wrong thing the whole time.
    – Allan
    Commented Jan 18, 2020 at 18:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .