su on buster, is this normal now?

Discussion about development of the Debian OS itself
Post Reply
Message
Author
User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: su on buster, is this normal now?

#16 Post by sickpig »

@4D696B65 y is ur penguin sad?

User avatar
Soul Singin'
Posts: 1607
Joined: 2008-12-21 07:02

Re: su on buster, is this normal now?

#17 Post 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.

User avatar
4D696B65
Site admin
Site admin
Posts: 2631
Joined: 2009-06-28 06:09
Been thanked: 5 times

Re: su on buster, is this normal now?

#18 Post by 4D696B65 »

sickpig wrote:@4D696B65 y is ur penguin sad?
nope, just had 4 bowls this morning and only 1 was cereal. :mrgreen:

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: su on buster, is this normal now?

#19 Post by sickpig »

hahaha :lol: that ought to do it! ok me exits from this thread dont want to sidetrack this post of Soul Singin'

Post Reply