I wanted to SSH into a machine, and I got a very weird error message:
unix_listener: path "/Usersfirstname.lastname@example.orgFthlK8q5qNkrXW4" too long for Unix domain socket.
This seems to be the culprit:
- I am “persisting” SSH connections in my SSH config folder, precisely here:
- The configuration for this is:
Host ... ControlMaster auto ControlPath ~/.ssh/sockets/%r@%h-%p ControlPersist 600
- Before opening a connection, SSH looks for an existing socket in
$HOME/.ssh/sockets, and if found re-uses it
- There is a 100-something length limit for “path to a socket” under Mac OS
- This path length limit was overshot with that 106-character long path
Solution: Shorten the path by using
%C instead of
Host ... ControlMaster auto ControlPath ~/.ssh/sockets/%C
That is it.