0

The username contains slashes. If I use standard ~/.ssh/sockets/master-%r@%h:%p as the ConfigPath, ssh would complain that unix_listener: cannot bind to path ~/.ssh/sockets/master-username/which/contains/slash@host_ip:port.s5FLlcqcHkethwd0: No such file or directory.

It seems the slash in the username is interpreted as path seperator.

How could I get around this?

1 Answer 1

4

That's what the %C token is for. From the docs:

%C    Hash of %l%h%p%r.

Since it generates a hash of the username (and other data), you don't need to worry about your username containing weird characters.

For example, if I run:

ssh -M -o ControlPath=/tmp/control-%C alice@example.com

I might find a socket named:

/tmp/control-3ba0719e3df95b719713923899a65f64655dea64
2
  • Thanks! saved my day!
    – Wei Qiu
    Jun 9 at 12:45
  • 2
    @WeiQiu Good! If this solves your issue, please consider accepting the answer. Accepting an answer marks the issue as resolved.
    – Kusalananda
    Jun 9 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.