When you run:
ssh host some command
ssh doesn't request a pseudo-tty device to be used on the remote end. The stdout and stderr or the remote commands are pipes instead.
exec("remote-user-login-shell", ["remote-user-login-shell", "-c", "some command"])
rsh mode. When you don't specify a command, it enters the
rlogin mode, where it does start a pseudo-terminal, and runs a login interactive shell session, where it runs:
(with a leading
- in the
argv to tell the shell it is to behave as a login shell).
-t when you need to run a specific command interactively (like
vi) in which case
sshd does create a pseudo-terminal on the remote host to interact with the remote command. If not, you do not want to use
ssh host bash
bash doesn't do nothing, it's just not interactive. It will process the input the same way as it would process a script or like you would get by running
cat | bash. You can still enter commands and see their output.
ssh replaced) was actually running
rlogin when not given any command to run, and
rlogin was invoking a different service (on a different TCP port) from the