Page 2 of 2

Re: su on buster, is this normal now?

PostPosted: 2019-05-23 08:08
by sickpig
@4D696B65 y is ur penguin sad?

Re: su on buster, is this normal now?

PostPosted: 2019-05-23 12:57
by Soul Singin'
For clarity, let's look at this on two different machines: one running Debian Wheezy and one running Debian Buster. And to ease comparison, let's use the following prompts:

Code: Select all
w$ == wheezy normal user
b$ == buster normal user
w# == wheezy root
b# == buster root

Here is a normal user's $PATH. It is the same on both systems:

Code: Select all
w$ echo $PATH
/home/soul/.bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Code: Select all
b$ echo $PATH
/home/soul/.bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

Now, let's login as root both ways on both systems. First, let's use su -

Code: Select all
w$ su -
Password:
w# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
w# exit
logout
Code: Select all
b$ su -
Password:
b# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
b# exit
logout

Once again, the $PATH is the same.

The difference, of course, is in the behavior of su (alone)

Code: Select all
w$ su
Password:
w# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
w# exit
exit
Code: Select all
b$ su
Password:
b# echo $PATH
/home/soul/.bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
b# exit
exit


So the difference is that when you login with su (alone) now, the root user no longer has $PATH access to the executable files in the: /usr/local/sbin, /usr/sbin and /sbin directories, but does have $PATH access to the executable files in /usr/local/games, /usr/games and the normal user's $HOME/.bin.

Re: su on buster, is this normal now?

PostPosted: 2019-05-23 13:44
by 4D696B65
sickpig wrote:@4D696B65 y is ur penguin sad?

nope, just had 4 bowls this morning and only 1 was cereal. :mrgreen:

Re: su on buster, is this normal now?

PostPosted: 2019-05-23 22:06
by sickpig
hahaha :lol: that ought to do it! ok me exits from this thread dont want to sidetrack this post of Soul Singin'