scap-workbench icon indicating copy to clipboard operation
scap-workbench copied to clipboard

Scanning remote target on MacOS fails with ssh-error: "path ... too long for Unix domain socket"

Open Benno-K opened this issue 5 years ago • 2 comments

On MacOS ssh's ControlPath gets too long, so you get an error similar to:

Can't connect to remote machine! Exception was: There was a problem with SshConnection! 
Failed to create SSH master socket! 
Diagnostic info: Starting process '/usr/bin/ssh -M -f -N -o ServerAliveInterval=60 -o ControlPath=/private/var/folders/n_/234pymm5149_ycvvl26572yc0000gn/T/scap-workbench-NDlAEr/ssh_socket user@somehost' 
stdout: =============================== 
stderr: =============================== 
unix_listener: path "/private/var/folders/n_/234pymm5149_ycvvl26572yc0000gn/T/scap-workbench-NDlAEr/ssh_socket.9JRdXUmnDlfRr63y" too long for Unix domain socket 

When an error like this happens outside scap-workbench, it can be easily remedied by creating a ~/.ssh/ssh_config with content like

Host *
  ControlPath ~/.ssh/control-%C
  ControlMaster auto

But the scap-workbench seems to ignore settings in that file and to "hard-code" the socket with a much too long path. Remark: the length is limited to 184 characters including the trailing 0

Benno-K avatar Mar 23 '20 16:03 Benno-K

Workaround - change $TMPDIR variable to something shorter. It's not necessary to change it globally, just change it for current shell session:

TMPDIR=/tmp; open /Applications/scap-workbench.app

2b avatar Mar 23 '20 21:03 2b

Thank you 2b! The suggested workaround indeed makes it work. Helps a lot.

Sometimes you just don't think about the obvious.

Benno-K avatar Mar 24 '20 10:03 Benno-K