Terminal not launching with different config files
houghi
houghi at houghi.org
Tue Aug 30 23:06:11 CEST 2011
On Tue, Aug 30, 2011 at 03:28:51PM -0400, David Rosenstrauch wrote:
> If you're doing a bunch of commands as root, you can just do "sudo
> -s" to get a root shell. So:
>
> [you at some_server ~]$ sudo -s
> Password:
> [root at some_server ~]$ vi /et/whatever
> ...
> [root at some_server ~]$ something
> ...
> [root at some_server ~]$ rcapache restart
> ...
> [root at some_server ~]$ what
> ...
> [root at some_server ~]$ exit
> exit
> [you at some_server ~]$
[~]
houghi at penne : sudo -s
penne:/home/houghi # echo $PATH
/usr/sbin:/bin:/usr/bin:/sbin
penne:/home/houghi # exit
[~]
houghi at penne : su -
Password:
penne:~ # echo $PATH
/usr/lib64/mpi/gcc/openmpi/bin:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib64/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin
I also miss the advantage of `su -` where I MUST enter the password. With
`sudo -s` I can log out and somebody else could log in.
`sudo -i` does show the correct path, but also has the disadvantage _for
me_ to be asking a password each and every time. Probably that could be
done different as well and I could be configuring `sudo` to behave just
like `su -`, but why would I need to do that if `su -` already does what I
want it to do?
>From the man page:
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.
Why simulate if I can have the real thing? At least that is my reason. Other
people will have other reasons and therefore will have a different conclusion.
houghi
--
If you owe the bank $100 that's your problem.
If you owe the bank $100 million, that's the bank's problem.
If you owe the bank $700 billion, it becomes your problem again.
More information about the Xfce
mailing list