If there is a socket file, SSH can multiplex the connection. In order to create a socket, we use: ssh -M -S /tmp/hello me@example.comFor example, in order to run a command on the server by using this socket file:ssh -S /tmp/hello example.com uname -a SSH requires host field while using -S /tmp/hello, but doesn't care. The following has the same effect: ssh -S /tmp/hello whocares uname -aWhy does SSH require, but doesn't care about the hostname?This behaviour of SSH (sharing the connection described with the socket file (/tmp/hello) and ignoring any credentials) is both what I wanted and what I expected. But requiring the hostname is somewhat confusing. Question comes to this point: Would I ever have a problem if I use this command as follows: ssh -S /path/to/my-first-host.socket example.com .... # expect connecting first hostssh -S /path/to/my-second-host.socket example.com .... # expect connecting second hostssh -S /path/to/my-third-host.socket example.com .... # expect connecting third host
Why does SSH requires but doesn't care about host address when using SOCKET file?
ssh;openssh