# su problem

## Chemtux

A couple of days back, I started having problems with 'su', I can still run the command, but after that I can't launch every program like ifconfig or give a init 0. 

Does somebody have any ideas

Greetz

----------

## ElCondor

you have to "su -" 

an ordinary su gives you superuser privileges, but su - performs a (nearly) full login, including setting the paths for root.

"ifconfig" is in /sbin/ which is not in the $PATH for normal users 

* ElCondor pasa *

----------

## Chemtux

Thanks, but when did this change??? And do they mention this anywhere standard??

----------

## rizzo

Linux has always been that way, as far as I've used it (6 years).  It's not just a gentoo thing.  It applies to su to any user, not just the root login.

Perhaps before you had actually logged in as root.

----------

## Chemtux

Hi,

I have also been using linux for at least six years, but after the installation of gentoo-1.0, is was possible to run ifconfig, when I used su from within the wheel group. And I know from other distro's like SuSE it is also possible with only the command 'su', to change the runlevel to zero and run ifconfig.

I think this was caused by a resent update I performed, I will try to find out which...............not so long ago I did a major update and changed the base-layout of the system..................

----------

## rizzo

meh.  I just have the habit of always including the dash.  Never run into problems then.

----------

## radfaraf

I noticed with su - I get my nice prompt instead of bash-2.05a$

where are the settings for this being loaded from.

----------

## AutoBot

Same thing has happened to me and I haven't done any major updating, no big deal but it would be nice to know what happened. 

   I hate when something changes without me doing it  :Very Happy: 

To radfaraf you can add the following to your ~/.bashrc and achieve the same effect if I understand what your saying.

```

source /etc/profile

```

----------

## radfaraf

I see the code i wanted in there

export PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'  

 :Very Happy: 

----------

## TwoSlick

Strange thing.  Same thing happened here, but I noticed something.  When I do the plain su, I don't have the correct paths, but I CAN open X-windows programs finally.

When I tried su -   , the paths are correct, but I'm back to not being able to open x-windows programs.

Now.....  I tried Autobot's suggestion of adding source /etc/profile, and now I have the best of both worlds.  With plain su, I have all of my correct settings, AND I can open X-win programs!!!    :Very Happy: 

- Tim

----------

