Re: How to seize control of user terminal?

From: A. Nonny Mouse (alpha_at_werkz.cz)
Date: 08/18/04


Date: Tue, 17 Aug 2004 23:38:32 GMT

On Tue, 17 Aug 2004 11:51:31 +0200, Alexis Huxley wrote:

>> In other words:
>>
>> 1) Machine running at home
>> 2) SSH into home machine from work computer
>> 3) Come home and realize SSH task is still running, and I want to check
>> its progress or see the terminal output
>>
>> How can I "jump into" that SSH shell? I looked at screen and I can see
>> how I would make that work, but I want to know how to do it without having
>> to run screen beforehand. I'm root, so does that give me the privilege of
>> jumping in on any user shell session? If I am using a shell on a campus
>> computer, can the root account snoop my terminal session?
>
> Use 'screen' immediately after you slogin in the first place.
> When you come home use 'screen -D -RR'.
>
> Look at the screen man page for more details.
>
> If you've not got screen installed a quick good google on 'screen' and
> a few of the keywords from your posting will find it for you.
>
> Alexis

Well, I was trying to be clear, I guess I failed.

I am aware of screen. I agree that screen can be used to work around this
problem.

My question, though, is this: if a user has started a shell and has not
used screen, can that shell be commandeered by root?

Here is my scenario again:

1) User 'Teddy' starts an SSH shell to host 'Bear'. Teddy DOES NOT
USE SCREEN: the session is a run-of-the mill ssh login.
2) User 'root' decides to commandeer the shell session started by user
'Teddy'.

How would root accomplish step 2? Can root acquire or somehow 'listen'
to the output of Teddy's SSH session? Can root cause keystrokes to be
sent into Teddy's session? Can root prevent Teddy from entering input to
the session?

Basically, I'm wondering if root can manually do this small fraction of
what screen can do.



Relevant Pages

  • Re: How to add dir to path
    ... Session 1: ~/scripts YES ... If you set an environment in a shell, ... you're logging in as root, then it is sourced as root, if you are ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: BSM, SSH, and Session ID
    ... Are you logging in as root through ssh or is that just the way it is ... Sun SSH/OpenSSH should fork off before the login because the sshd ... It should always be a different session, ...
    (Focus-SUN)
  • Re: SSH Problem on Solaris 9
    ... I have a fresh install of Solaris9 and have enabled the root user to login ... My problem is if I change the root user's shell from sh to bash, ... I'm denied login using ssh unless I change it back to sh. ...
    (comp.unix.solaris)
  • Re: BSM, SSH, and Session ID
    ... I can't recall how Sun SSH on Solaris 9 behaves but recent versions of Sun SSH/OpenSSH should fork off before the login because the sshd process that a user is connected to after authentication runs with their privileges, ... It should always be a different session, even if the user login is root. ...
    (Focus-SUN)
  • Re: FC9 Compromised...
    ... could be something as simple as users who can get pop3 e-mail and also ... someone a local shell and when that happens, ... of time before they get root. ... somehow if they got onto several boxes unless you used passwordless ssh ...
    (Fedora)