Re: dangerous to leave root logged in?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

On Mon, 28 Mar 2005 15:28:43 -0800, Keith Keller wrote:

Quoted text here. Click to load it

Oh come on.  You guys are getting desperate now.  You can't provide
a concrete, *technical* answer to his question,  he won't accept
your religious *nix dogma, and you're grasping at straws now.

Hmm.  Users will make mistakes if they use a root shell that's
already open, but they won't make those mistakes if they have to
login first.  No, sorry... it just doesn't make sense.

Keeping root logged OUT most of the time seems like safe conservative
advice, since it probably won't do any harm.  But if there's a
*technical* risk (not a personnel risk) in having a root shell open
from one console, while another user is logged into another console,
what IS it, exactly?  If the root shell is a security hole when it's
been open for an hour, isn't it a security hole during the 30 seconds
that you'd have it open?  If somebody on the LAN knows of a security
vulnerability of open root logins, won't he have a script or program
that watches for that root login and exploits it the instant that
it appears?

So... what IS that vulnerability?  I wouldn't be surpised to hear
that there is one (I'd be surprised if there isn't), but what IS
that vulnerability?  This question comes up frequently, and nobody
ever has an informed, useful answer- just insults for the questioner,
and advice like "If you weren't stupid, you'd use <insert name of
software here>", "You post to Usenet with a Windoze program, so
you shouldn't be allowed to ask questions about Linux!"... as if
people should post to Usenet using the company SERVER, instead of
their desktop machine.  

Most of the opinions preached here, regarding how things should
be done, seem to be based on corporate experience in situations
where anybody and his dog could wander in & out of the machine
room unwatched and unsupervised.  Those experiences don't prove
that root access is bad; they prove that you should have locked
the door to your office.  Or that the boss should stop giving
group tours of the IT department to all visitors. ;-)

I can't believe how many of you suggest remote "secure" login as
a solution to the problem.  How could anybody possibly believe
that remote root login is safer than console-only root login??

Maybe my viewpoint on "secure remote access" is different because:
A:  I don't use a Linux GUI.
B:  I don't work in a corporate IT environment, "helped" by the
    half-trained chimpanzees that serve as IT employees nowdays.
C:  I run Web/Mail/FTP servers, where those chimpanzees (when
    they go home for the night) spend all their time banging on
    my Web server with bananas, trying to hack in.

Wait... I wandered off the thread topic... Oh, yeah:  what is the
danger of an open root shell login being exploited by another
user on the network?  

Re: dangerous to leave root logged in?

On Tue, 29 Mar 2005 23:17:53 +0000, Julia Thorne mumbled something like

Quoted text here. Click to load it

If you have a logged in root shell, say on the console, Ctrl-Alt-F1, or on
a second X server(say localhost:1), and you allow joe user physical access
to the system, there is nothing to prevent joe user from pressing
Ctrl-Alt-F1 or Ctrl-Alt-F8 and using your open root session. This is not

If a process needs to run as root and needs to run all the time, it is
probably better to run it in the background from an init script.

    /  \

Re: dangerous to leave root logged in?

Quoted text here. Click to load it

?? Perhaps noone answers it for you because you do not read. It is easy not
to see with your eyes closed.

Any program that root runs increases the chances of a root comprimise due
to bugs in the program. X is a huge system with many many parts, and the
chances of bugs in X is large (never mind the chances of misconfigurations
-- eg root's .xhost having a + on its own in which case anyone in the world
can connect to and read teh X session running on the machine. )

So, the fewer the programs running and the more those programs have been
vetted for holes ( and are therefor relatively simple programs), the better.

Is it a disaster to run as root? No. Can you make mistakes? Yes ( just a
couple of weeks ago I was doing some work on a remote machine. I wanted to
shut down my laptop and issued a halt instruction. It was only later I
found that I had actually beenn logged into the remote machine when I
issued the instruction. That machine, a server, was shut down for 3 days
until I could get to it. This all of course occured on a weekend when noone
else was aroung to restart the server.)

Is it silly to run as root? Not if you need to but you should make sure
that it is on a need to basis.

If you leave root logged into a console then anyone with access to the
machine immediately has root access. Is that acceptable? It depends on who
has access.

Quoted text here. Click to load it

It depends on the attack vector.

Quoted text here. Click to load it

Re: dangerous to leave root logged in?

Quoted text here. Click to load it

I am grasping at nothing.  I already stated in this thread that there's
probably no technical problems with what he wants to do!  (Of course, I
CMA too: I said *probably*, not *definitely*.)  And it it hardly
religious dogma: things like what I describe have actually happened.
Well, almost, in my case: I caught the person before she could do
anything bad.  But what if I hadn't been there looking over her

Quoted text here. Click to load it

Of course it does.  The mistake might be that the user doesn't even
realize he's typing into a root shell.  If he just typed the root
password 30 seconds ago, it's unlikely (though of course possible) that
he'll forget he's currently using a root shell.  But if he has four
xterms open, one of which is a root shell, he might accidentally get the
focus into the wrong one.

Quoted text here. Click to load it

Nobody has suggested this.  They've suggested not to have idle root
logins running at all, remote or otherwise.  The ''solution'' you are
misunderstanding is to log in remotely, do your business, and *log out
when done*, as opposed to leaving a running console open.  Of course,
the best solution is to walk to the console, log in, do your business,
and log out when done.  If that's what the OP wants to do, rather than
log in remotely, that's fine.  But the two components, login remotely
and logout when done, are completely orthogonal to each other.

Quoted text here. Click to load it

I don't see how any of the above justifies leaving an idle root shell
open, especially if there are other ways of doing the same thing.  I
would like to see an example of what you believe is a situation that
*requires* an idle root shell running at all times.  Thus far in this
thread, I haven't seen any such examples.


(try just my userid to email me)
see X- headers for PGP signature information

Re: dangerous to leave root logged in?

Quoted text here. Click to load it

I am constantly guilty of this
I have multiple xterms open some with root logged in
and the number of times I have executed commands as root when I meant to
do this as a user is to the point you would have thought I have learnt my
lesson by now
(usually I wince for an hour or so then go right back to doing it)


Hardware, n.: The parts of a computer system that can be kicked

Re: dangerous to leave root logged in?

Hash: SHA1

Quoted text here. Click to load it

Vulnerability ?: How about one program becomes vulnerable and there are
say a few rxvt's on your desktop that the user is su - rooted and that
program that is vulnerable has the ability to modify the acting buffer
of those rxvt's and send commands right to the terminal for execution.
In that case would you really like to leave a su - rooted terminal open
or even a tty open ?. I wouldnt but then again I make sure to take other
precautions as well. I know this is a little far fetched idea but other
far fetched ideas have allready been realized and noones to tell what
will come in the future.

Version: GnuPG v1.4.0 (FreeBSD)
Comment: Fingerprint = D1DC 0AA4 1C4E EAD4 24EB  7E77 B261 50BA F7DF 979F


( When in doubt, use brute force. -- Ken Thompson 1998 )

Re: dangerous to leave root logged in?

Quoted text here. Click to load it

I avoid this with a short shell script (see below) that I call "rw" for
"root window" that sets the background color to one color if it is a
local root, and a different one if it is remote.  This way I am clued
in immediately by the background color about whether a given window is
running as my regular user account, local root, or remote root.

That being said, I screen lock my workstation when I walk away from
it, and my office door is set so that it locks when it is closed.  I
would never leave an unlocked root window/console on a machine used by
regular (non-priveleged) users.

If the OP insists on leaving root logged in on a multi-user machine,
despite the recommendations of everyone here (myself included), the
best that he can do is to set the screensaver to lock after one minute
of idle time (for X), and/or religiously use either "vlock" or
"lockvt" (for console) when walking away from the machine.  But these
are at least somewhat fragile in that they rely on either a small
timeout or remembering to lock *every* time you walk away.  So the
answer still mostly boils down to "don't do that".

mez$ more ~/bin/rw

if [ $# = 0 ] ; then
    host=`hostname | perl -pe 's/\..*//'`
    root="su -"
    root="ssh $host -l root"


xterm -bg $bg -fg black -fn 7x14 -title $title -e $root &
# end of rw script


Michael Zawrotny
Institute of Molecular Biophysics
Florida State University                | email:
Tallahassee, FL 32306-4380              | phone:  (850) 644-0069

Re: dangerous to leave root logged in?

On Wed, 30 Mar 2005 17:27:38 +1200, Shane (aka froggy) wrote:
Quoted text here. Click to load it

  I use a different color scheme for root xterms.
Wheat text on black background = my default user.
Black text on light blue background = root.

  Then there are other color schemes for other users.
I always know at a glance who the xterm belongs to.
Type something as root without realizing it's root?
Can't happen.  The light blue background won't, for a
millisecond, let you think it's a youser xterm.

Steve Ackman

Re: dangerous to leave root logged in?

Julia Thorne wrote:
Quoted text here. Click to load it
Results 1 - 50 of about 6,080 English pages over the past 6 months for
linux bash vulnerabilities fedora.

Just one distro.  Enough said?


Re: dangerous to leave root logged in?

On 29 Mar 2005 21:11:39 -0800, prg wrote:

Quoted text here. Click to load it
Quoted text here. Click to load it

No, it's not enough- it isn't ANYTHING.  Any idiot can type a few
words into a search engine & get a boatload of "results".

How many of those results have anything to do with the question?
There are MANY exploits available to people with shell access,
including many to escalate priveleges *FOR THAT USER*, but NONE of
those (in the search you quoted above) will let a user on a LAN
get into an open shell (root or not) on some *other* computer
on the lan.

Nobody can answer the posted question.  Either they don't GET
the question, or they are just hiding behind a bullshit storm.

Site Timeline