Re: Problem with su -

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

 



Aaron Konstam wrote:
> The only way you can get a prompt containig root is by using su - .
> su will only produce a root prompt  by starting as root. It it not
> posible to do this:
> 
>           [bobg@box6 ~]$ su
>              Password:
>              [root@box6 bobg]#

Emilio Lopez wrote:
> Im doing exactly this to become root for years with fedora with no
> problems. Why is this wrong?

The difference between su and su - , according to the man page, is that
su - gives you a login shell. Among other things, that means bash runs
/etc/profile and one of ~/.bash_profile, ~/.bash_login, or ~/.profile¹.
The default Fedora ~/.bash_profile runs ~/.bashrc, which runs
/etc/bashrc, but Aaron might have his own variants that don’t do this.
It’s possible that this means he doesn’t see “root” in his bash prompt
if he just does su.

Alternatively, Aaron might have meant that su on its own inherits a
number of settings (including $PATH) from the normal user session. In
particular, normal users (and what you get after a plain su) have */bin
entries in $PATH before the equivalent */sbin entry, whereas “real” root
(or what you get after running su -) has the */sbin entries before
*/bin. 

So
su
system-config-keyboard
will run /usr/bin/system-config-keyboard which is a symlink to consolehelper
but
su -
system-config-keyboard
will run /usr/sbin/system-config-keyboard

Hope this illuminates matters!

James.

¹ Bash will run the first file it can find out of those three.
-- 
E-mail:     james@ | You can accept the existence of rain without denying the
aprilcottage.co.uk | existence of umbrellas.
                   |     -- http://ozyandmillie.org/2006/om20060615.html
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux