FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 12-17-2009, 02:56 PM
Rick Morneau
 
Default Why doesn't sudo read /root/profile?

Whenever I "sudo" or "sudo su root", my PATH variable is
some kind of minimal default instead of what's specified in
/root/.profile. Is there some way to provide a real root
environment when using "sudo"?

Thanks!

--

Regards,

Rick Morneau
ram@eskimo.com



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-17-2009, 03:02 PM
Marius Gedminas
 
Default Why doesn't sudo read /root/profile?

On Thu, Dec 17, 2009 at 08:56:44AM -0700, Rick Morneau wrote:
> Whenever I "sudo" or "sudo su root", my PATH variable is
> some kind of minimal default instead of what's specified in
> /root/.profile. Is there some way to provide a real root
> environment when using "sudo"?

Perhaps you want to use 'sudo -i' instead of 'sudo -s'.

Marius Gedminas
--
I'll maintain that XML should never be used for something that is written by
humans, just as you shouldn't try to use it as a programming language, although
people have been so in love with XML that they've tried to do both.
-- Bruce Eckel
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-17-2009, 03:03 PM
Werner Schram
 
Default Why doesn't sudo read /root/profile?

Rick Morneau wrote:
> Whenever I "sudo" or "sudo su root", my PATH variable is
> some kind of minimal default instead of what's specified in
> /root/.profile. Is there some way to provide a real root
> environment when using "sudo"?
>
> Thanks!
>
Yes, use "sudo su -" and you are set! Note that if you want a root shell
with your own (user) environment, you can use "sudo -s". That way, you
have a fully functional environment, without unnecessary cluttering the
/root directory.

Werner

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-17-2009, 03:28 PM
Markus Schönhaber
 
Default Why doesn't sudo read /root/profile?

17.12.2009 16:56, Rick Morneau:

> Whenever I "sudo" or "sudo su root", my PATH variable is
> some kind of minimal default instead of what's specified in
> /root/.profile. Is there some way to provide a real root
> environment when using "sudo"?

sudo -i

from man sudo:

| -i [command]
| The -i (simulate initial login) option runs the shell
| specified in the passwd(5) entry of the target user as
| a login shell. This means that login-specific
| resource files such as .profile or .login will be read
| by the shell. If a command is specified, it is passed
| to the shell for execution. Otherwise, an interactive
| shell is executed. sudo attempts to change to that
| user's home directory before running the shell. It
| also initializes the environment, leaving DISPLAY and
| TERM unchanged, setting HOME, SHELL, USER, LOGNAME,
| and PATH, as well as the contents of /etc/environment
| on Linux and AIX systems. All other environment
| variables are removed.

--
Regards
mks

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-18-2009, 02:50 PM
Rick Morneau
 
Default Why doesn't sudo read /root/profile?

On Thu, Dec 17, 2009 at 06:02:11PM +0200, Marius Gedminas wrote:
> On Thu, Dec 17, 2009 at 08:56:44AM -0700, Rick Morneau wrote:
> > Whenever I "sudo" or "sudo su root", my PATH variable is
> > some kind of minimal default instead of what's specified in
> > /root/.profile. Is there some way to provide a real root
> > environment when using "sudo"?
>
> Perhaps you want to use 'sudo -i' instead of 'sudo -s'.
>
> Marius Gedminas
>

Yes! Thanks! (to you and to all the others that replied)


--

Regards,

Rick Morneau
ram@eskimo.com



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-18-2009, 05:10 PM
NoOp
 
Default Why doesn't sudo read /root/profile?

On 12/17/2009 08:28 AM, Markus Schönhaber wrote:
> 17.12.2009 16:56, Rick Morneau:
>
>> Whenever I "sudo" or "sudo su root", my PATH variable is
>> some kind of minimal default instead of what's specified in
>> /root/.profile. Is there some way to provide a real root
>> environment when using "sudo"?
>
> sudo -i
>
> from man sudo:
>
> | -i [command]
> | The -i (simulate initial login) option runs the shell
> | specified in the passwd(5) entry of the target user as
> | a login shell. This means that login-specific
> | resource files such as .profile or .login will be read
> | by the shell. If a command is specified, it is passed
> | to the shell for execution. Otherwise, an interactive
> | shell is executed. sudo attempts to change to that
> | user's home directory before running the shell. It
> | also initializes the environment, leaving DISPLAY and
> | TERM unchanged, setting HOME, SHELL, USER, LOGNAME,
> | and PATH, as well as the contents of /etc/environment
> | on Linux and AIX systems. All other environment
> | variables are removed.
>

And: https://help.ubuntu.com/community/RootSudo
might also be of use.



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 03:49 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org