|
Bugzilla – Full Text Bug Listing |
| Summary: | servername disappears after sudo -s | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | edweger <ernst.deweger> |
| Component: | Sudo | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | RESOLVED INVALID | ||
| Severity: | normal | ||
| Priority: | normal | ||
| Version: | 1.6.8 | ||
| Hardware: | Sun | ||
| OS: | Other | ||
|
Description
edweger
2007-12-05 05:02:56 MST
Chances are that the environment variable used in your prompt is not being preserved when you run sudo. Starting with sudo 1.6.9, commands run by sudo inherit a minimal environment instead of a copy of the caller's environment. Sudo will preserve the HOSTNAME environment variable by default but your prompt may be using something else. If you look in your .profile you can probably figure out what that is. Then you can add a line like the following to the top of your sudoers file. Default env_keep += HOST replacing HOST with whatever the environment variable you need to preserve really is. Another alternative is to use "sudo -i" instead of "sudo -s". Unlike -s, -i will run a login shell which will source the .profile of the target user. This is almost certainly an environment variable issue. |