su on buster, is this normal now?

News and discussion about development of the Debian OS itself

Re: su on buster, is this normal now?

Postby sickpig » 2019-05-23 08:08

@4D696B65 y is ur penguin sad?
User avatar
sickpig
 
Posts: 317
Joined: 2019-01-23 10:34

Re: su on buster, is this normal now?

Postby Soul Singin' » 2019-05-23 12:57

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
Soul Singin'
 
Posts: 1574
Joined: 2008-12-21 07:02

Re: su on buster, is this normal now?

Postby 4D696B65 » 2019-05-23 13:44

sickpig wrote:@4D696B65 y is ur penguin sad?

nope, just had 4 bowls this morning and only 1 was cereal. :mrgreen:
User avatar
4D696B65
 
Posts: 2438
Joined: 2009-06-28 06:09

Re: su on buster, is this normal now?

Postby sickpig » 2019-05-23 22:06

hahaha :lol: that ought to do it! ok me exits from this thread dont want to sidetrack this post of Soul Singin'
User avatar
sickpig
 
Posts: 317
Joined: 2019-01-23 10:34

Previous

Return to Debian Development

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable