screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using screen after sudo bash


From: Kipling Inscore
Subject: Re: Using screen after sudo bash
Date: Wed, 25 May 2011 11:57:21 -0700

On Tue, May 24, 2011 at 11:54, John K. Sherwood <address@hidden> wrote:
> Hello all,
> I've been using screen for a while, but recently one of our system
> administrators noticed an interesting quirk of screen that made me wonder.
>  It seems that if you run 'screen' after running 'sudo bash', the system (as

Without exit after sudo bash, i.e. as below?

user$ sudo bash
password:
root# screen

or after lowering your privileges again?

user$ sudo bash
password:
root# exit
user$ screen

> shown by the utilities 'w' and 'who') no longer sees you as "username
> [priv]", but instead as "root" directly.  Is this intentional?  It seems as

It seems to be the default behavior of running anything after 'sudo
bash' (and before exit), since this command runs bash as root. Check
'whoami' after 'sudo bash', do you get 'root'?
I don't think screen is doing anything differently from other commands
in this regard, unless you still get root after exiting from 'sudo
bash' (I don't).

> though screen should maintain your identity unless expressly instructed to
> log you in as someone else.  Maybe I'm missing something though?

by running 'sudo bash', you've essentially logged in as root, thus
your identity to is root and screen is maintaining this.
If you want to run screen (or any command) as yourself, I don't think
you should be running 'sudo bash' first.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]