0

Running a Mac laptop with OSX Sonoma 14.6.1.

  • Trying to SSH from the Mac to a Raspberry Pi that I have set back up again. This Pi was in use some time ago and I was previously able to SSH into it.

  • Have updated the Raspberry Pi and verified that SSH is operational. I can SSH into the Pi from other instances on the same network. I simply cannot connect to it from the Mac laptop.

  • If I try to SSH from the laptop I get

    ssh: connect to host xxx.xxx.1.xxx port 22: Connection refused
    

From the same Mac laptop I can SSH into other hardware or machine instances so there is no firewall blocking

  • If I run with -vvv for debug I get:
    debug1: Reading configuration data /etc/ssh/ssh_config 
    debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files debug1: /etc/ssh/ssh_config line 54: Applying options for *
    debug2: resolve_canonicalize: hostname xxx.xxx.1.xxx is address
    debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/Chris/.ssh/known_hosts'
    debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/Chris/.ssh/known_hosts2'
    debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
    debug3: channel_clear_timeouts: clearing
    debug3: ssh_connect_direct: entering debug1: Connecting to xxx.xxx.1.xxx [192.168.1.248] port 22.
    debug3: set_sock_tos: set socket 3 IP_TOS 0x48 debug1: connect to address xxx.xxx.1.xxx port 22: Connection refused ssh: connect to host xxx.xxx.1.xxx port 22: Connection refused
    
  • I've tried to SSH with different apps - Terminal, Termius and Hyper but same underlying issue blocking this specific connection.
  • I've tried changing the IP of the Raspberry Pi but it's made no difference.
  • I've verified that I can SSH into other machines from the Mac laptop with zero issues.
  • I've verified that SSH is working on the Pi and have connected from other machines.
  • I've ran traceroute and it's a single route from my laptop to the Pi

Expecting to be able to SSH into the Pi as I have before and can with other devices

Update trying to look at logs:

Mar 11 15:44:01 raspberrypi polkitd(authority=local): Registered Authentication Agent for unix-process:4151:521958 (system bus name :1.63 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_AU)
Mar 11 15:44:10 raspberrypi polkitd(authority=local): Operator of unix-session:6 successfully authenticated as unix-user:USERNAME to gain TEMPORARY authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.64 [systemctl restart ssh] (owned by unix-user:USERNAME)
Mar 11 15:44:10 raspberrypi sshd[652]: Received signal 15; terminating.
Mar 11 15:44:10 raspberrypi sshd[4162]: Server listening on 0.0.0.0 port 22.
Mar 11 15:44:10 raspberrypi sshd[4162]: Server listening on :: port 22.
Mar 11 15:44:10 raspberrypi polkitd(authority=local): Unregistered Authentication Agent for unix-process:4151:521958 (system bus name :1.63, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_AU) (disconnected from bus)
Mar 11 15:44:40 raspberrypi sudo: USERNAME : TTY=pts/0 ; PWD=/var/log ; `USER=root ; COMMAND=/usr/bin/cat /var/log/auth.log
Mar 11 15:44:40 raspberrypi sudo: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)

Update 14 March

  • Upgraded Mac OS to 15.3.2. Despite changes to SSH issue persists
  • Tried laptop connection with ethernet to rule out this being a WIFI issue. Problem persists
  • Created a new account on the Mac and tried from that. Issue persists

Convinced at this point problem resides on Mac Laptop as nothing indicates connection is reaching Pi to be declined.

5
  • 1
    Do you have any particular SSH client configuration on the macOS system (a ~/.ssh/config file)? What's that $SSH_SK_PROVIDER about? Commented Mar 11 at 7:04
  • Your MacOS log shows the IP address it's trying to use for the Raspberry Pi (unsuccessfully). What do the logs show on the other computers that are successful? The same IP address, or a different IP address? Commented Mar 11 at 8:18
  • @Kusalananda no, to the best of my knowledge I've never made changes to the ~/.ssh/config file. No idea what the $SSH_SK_PROVIDER is. Nothing I've ever added and I can't find any reference to that in any file I've looked in. Likewise, I don't have any file called .ssh/known_hosts2 Commented Mar 11 at 9:22
  • What do you see in the ssh daemon logs on the server side of the connection at the time your Mac tries to connect? If you are using /etc/hosts.deny, is the Mac happening to be using a denied IP address and therefore not even able to get to the SSH dæmon? Commented Mar 11 at 16:29
  • The /etc/hosts.deny is not used and is empty. There is nothing in the logs on the server, like the connection is simply not reaching the server at all to be declined. The issue seems to be completely on the laptop Commented Mar 12 at 8:38

1 Answer 1

0

I had the same issue recently. It seems to have started either with a MacOs update, or when I switched routers.

I tried different SSH clients to no avail. The connection only failed from my Mac to a Raspberry Pi, and worked from and to anything else.

After a lot of digging, I ended up solving it with:

ssh -o 'IPQoS=none' your_user@your_target_ip

You can make this fix permanent by adding it to your ~/.ssh/config file:

Host your_target_ip
    IPQoS none

I wish I could contextualize the answer with why it solved the problem, but I have no idea.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.