On Tue, Jun 13, 2017 at 2:48 AM, L A Walsh <b...@tlinx.org> wrote: > Clark Wang wrote: > >> >> I've checked the ssh process and it does not catch SIGTTIN and that's why >> I'm confused. >> >> > ---- > From what I understand, a background process will automatically > block when it tries to read from STDIN. By definition, processes > become bg-processes by using '&'. I haven't looked at the > code, but I'm guessing that the first 'ssh' that you launched > (*without* the '&') is the process swallowing your input as > it was declared to be a some sort of master-multiplexer for > subsequent slave processes, but that's just a guess. Maybe > putting the master in background @ launch (using '&') will > cause it to auto-block(suspend) as you expect? >
The first ssh (with `-f`) would fork another ssh running as a daemon which would detach from the current tty. It makes no difference whether to use `&` or not. Please see my explanation @stackoverflow: https://stackoverflow.com/questions/44492312/ . -clark