Mailinglist Archive: opensuse (3644 mails)

< Previous Next >
Re: [SLE] problem using su
  • From: Anders Johansson <andjoh@xxxxxxxxxxxxxxxxxxxxx>
  • Date: Fri, 22 Mar 2002 18:08:56 +0100
  • Message-id: <200203221808.56044.andjoh@xxxxxxxxxxxxxxxxxxxxx>
On Friday 22 March 2002 17.57, Tom Nicholson wrote:
I lose the convenience of having executables and directories listed in
color when I su to root. I log in as "tom" then do su. As tom I get color
listings, but when I su, it's back to b/w. I've read the /etc/profile file
and DIR_COLORS file, but don't know how to activate them when I do su. And
why should aliases defined to user tom disappear when su'ing to root? User
root doesn't have this problem. The color listings work fine.

This is a SuSE 7.2 pro box where it's just me learning some C++ and Qt
(and Linux). I basically don't have a firm concept of what all kicks in and
in what order during Linux boot. And to make matters worse this varies
by distro it seems.

Use "su -" instead of just su. The dash will cause all profile scripts to be
sourced, just as if you had logged in at the console.

All user settings will disappear when you su, and I think that's a good thing.
Imagine for instance what would happen if some bug in your web browser (for
example) allowed someone to set an alias for user tom, and that alias would
remain when you su:ed. Imagine if that alias was something like (psudo code)
ls=if(uid == 0) 'rm -rf /' ; else '/bin/ls'. Or worse.

//Anders

< Previous Next >
Follow Ups
References