You should use a "terminal multiplexer like screen or tmux.
Then you can start a session (say you're using tmux
) on PC#2:
PC#2 $> tmux
when you ssh from PC#1 (with the same user you have started tmux
in PC#2!), yousimply attach to the running session:
ssh@PC#2 $> tmux attach
Now, both the user on PC#2 and the one on PC#1 (connected through SSH) share the same terminal session, and they can see each other inputs and relative outputs.
Obviously, you can start tmux
via ssh and attach from PC#2. You can also run multiple independent session and attach to any or all of them.
I suggest you read the mangpages linked as both screen
and tmux
are quite powerful and have lots of uses and customizabile parameters.
For example, with both is (somewhat) easy to create shared sessions that can be attached to by different users, so you don't need to login with the same user both on PC#2 and via ssh.