Unix path too long for domain socket
Posted on August 8, 2022 (Last modified on July 2, 2024) • 1 min read • 119 wordsI wanted to SSH into a machine, and I got a very weird error message: unix_listener: path "/Users/me/.ssh/sockets/myservername_ansible@000-servername001.subdomain.main-domain-in-use.de-22.gFthlK8q5qNkrXW4" too long for Unix domain socket
.
This seems to be the culprit:
$HOME/.ssh/sockets
Host ...
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600
$HOME/.ssh/sockets
, and if found re-uses itSolution: Shorten the path by using %C
instead of %r@%h-%p
:
Host ...
ControlMaster auto
ControlPath ~/.ssh/sockets/%C
That is it.
Sources: