Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

su on buster, is this normal now?

User discussion about Debian Development, Debian Project News and Announcements. Not for support questions.
Post Reply
Message
Author
kanliot
Posts: 36
Joined: 2013-09-02 08:00

su on buster, is this normal now?

#1 Post by kanliot »

Someone on stackexchange told me that "sudo su" is wrong now. Is "su" also wrong, since swapon refuses to run?

Code: Select all

$ su
Password: 
root@maleday:/# swapon -s
bash: swapon: command not found
root@maleday:/# 
Mainly every problem I have is with disks and systemctl. PC refuses to shut down, I type ESC on the shutdown screen and it says (6min / No Limit) on the shutdown job. This is after disks are mounting with no error but with apparently no files on the filesystem. No idea if I've lost data. When is Debian going to figure out that udev is just mocking you?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: su on buster, is this normal now?

#2 Post by Head_on_a_Stick »

If you have sudo installed then use

Code: Select all

sudo -i
If you don't have sudo then use

Code: Select all

su -
HTH

EDIT: please open a separate thread for your shutdown problem.
deadbang

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: su on buster, is this normal now?

#3 Post by GarryRicketson »

You should be using

Code: Select all

su -
https://manpages.debian.org/stretch/login/su.1.en.html
Someone on stackexchange told me that "sudo su" is wrong now.
I don't use 'sudo' normally, but don't understand why one would use su that way .
When just

Code: Select all

su - 
is all that is needed.
I can't seem to duplicate this on Debian 9, and as far as Debian testing (will be Buster)
who knows, ? Since it has not yet been released as a stable version, who knows what the norm will be ?
The shutting down issue, is another question/topic all together,...maybe show us exactly what command you are using to shut down ?
Edit===HOAS responded while I was typing:
EDIT: please open a separate thread for your shutdown problem.
Agreed, so don't answer me here, give those details in the new topic.
by kanliot » No idea if I've lost data. When is Debian going to figure out that udev is just mocking you?
Me neither, I never lose data, but that is because I all ways make a backup , before shutting down, and that way have all the data saved, in case something went wrong.
As far as "When is Debian going to figure out that udev is just mocking you?", hmm, I don't know, my question, When will trolls learn that we have nothing to do with Debian Development, and are just Debian Users as well,... I suppose your system , Debian will figure those things out when the system admin learns how to administer and configure the system properly . I do know I had to do a lot of work to get Debian 9 working properly, for me, but yea, Debian it's self is not going to do that, the system admin needs to do it. :mrgreen:

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: su on buster, is this normal now?

#4 Post by GarryRicketson »

Someone on stackexchange told me that "sudo su" is wrong now.
P.S. I wouldn't trust what the say on stackexchange much, but agree, that sounds wrong, just plain does not make sense.

reinob
Posts: 1189
Joined: 2014-06-30 11:42
Has thanked: 97 times
Been thanked: 47 times

Re: su on buster, is this normal now?

#5 Post by reinob »

GarryRicketson wrote:
Someone on stackexchange told me that "sudo su" is wrong now.
P.S. I wouldn't trust what the say on stackexchange much, but agree, that sounds wrong, just plain does not make sense.
It makes sense if you are allowed to use sudo (e.g. with your own password) but don't have the password for root (which su needs).

It's just that to have a proper root environment you need "su -", i.e. "sudo su -"

Of course "sudo -i" (or sudo --login) will have the same (or rather, equivalent) effect. Maybe some (custom) implementations of sudo don't have the "-i" option, so you have to use sudo su -.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: su on buster, is this normal now?

#6 Post by GarryRicketson »

It makes sense if you are allowed to use sudo (e.g. with your own password) but don't have the password for root (which su needs).
Thanks, ok, that makes sense , and would be a valid reason.

kanliot
Posts: 36
Joined: 2013-09-02 08:00

Re: su on buster, is this normal now?

#7 Post by kanliot »

Ehhhh, I suppose if it's not documented, then it's a user-keyboard error, huh?
"Be conservative in what you send, be liberal in what you accept"
I'll use textual reconstruction to have this mean I have to accept bugs without complaining about them.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: su on buster, is this normal now?

#8 Post by GarryRicketson »

Well, not exactly,... if you really think you have a bug somewhere it should be reported,to the appropriate bug list.
I was just looking, to see if I could find anything on the "swapon" command, so far nothing, but this might be of interest:
https://wiki.debian.org/NewInBuster
Seems like you should try using "su -" as suggested, if you still get the:
bash: swapon: command not found

If you still get that error, maybe there is something like a bug, or the command has been changed, removed, replaced by a different name, who knows ?
On the Debian 9 VM, the "swapon" command works fine, no matter How I use su (su, or su -),....


User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: su on buster, is this normal now?

#10 Post by GarryRicketson »

For what ever it is worth,... I decided to go ahead and upgrade the VM, to Debian Buster, looks like it will take a while, but I want to see if I get the same problem with the 'swapon' command,... will post how it goes later.
==== edited ===
Yikes, it says estimated time 7 hrs, sometimes 9 hrs,... this is the problem with overly bloated OS's and software,...should have removed all the XFCE4 packages before doing this, I don't use them, installed OpenBox,... fortunately I did remove all the libre office bloat, that will help. Oh well,

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: su on buster, is this normal now?

#11 Post by pcalvert »

The main place I've seen "sudo su" used is on the live CD/DVD.

Phil
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

reinob
Posts: 1189
Joined: 2014-06-30 11:42
Has thanked: 97 times
Been thanked: 47 times

Re: su on buster, is this normal now?

#12 Post by reinob »

kanliot wrote:Ehhhh, I suppose if it's not documented, then it's a user-keyboard error, huh?
"Be conservative in what you send, be liberal in what you accept"
I'll use textual reconstruction to have this mean I have to accept bugs without complaining about them.
I don't know where you're quoting this from. It's not in this thread (?).

What you posted is Postel's law (according to Wikipedia "Robustness principle"), and refers to protocols, e.g. like SMTP or such. You, as sender, should be careful to adhere to the standard, while, as receiver, should be flexible enough to allow non-standard requests from non-conforming servers.

It has nothing to do with Debian, or with Buster, or with sudo, or with su.

BTW and for the record: swapon (/usr/sbin/swapon) works fine in Buster.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: su on buster, is this normal now?

#13 Post by p.H »

kanliot wrote:Someone on stackexchange told me that "sudo su" is wrong now.
"sudo su" has always been wrong
GarryRicketson wrote:
It makes sense if you are allowed to use sudo (e.g. with your own password) but don't have the password for root (which su needs).
Thanks, ok, that makes sense , and would be a valid reason.
No it does not make any sense. su is just useless in this context.
If you want a root shell, use sudo -s, sudo -i or sudo bash.

What has changed in buster is that now su without -/-l/--login does not set the root $PATH.

kanliot
Posts: 36
Joined: 2013-09-02 08:00

Re: su on buster, is this normal now?

#14 Post by kanliot »

p.H wrote: What has changed in buster is that now su without -/-l/--login does not set the root $PATH.
This actually makes me feel a lot better. I thought it was some kind of arcana.

I've also noticed that sometimes root doesn't have access to the x.org clipboard. This was after making sure root had access to the .Xauthority cookie.

I just tested the $PATH variable from su (with and without '-')

Code: Select all

/home/kanliot/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:~/bin
                 /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:~/bin
You can see what is missing is /usr/local/sbin, /usr/sbin, /sbin
and I'll point out /home/kanliot/bin is in the path, when using 'su'

I'd like to doublecheck this change is documented. Where do I check?

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

Re: su on buster, is this normal now?

#15 Post by 4D696B65 »

kanliot wrote: I'd like to doublecheck this change is documented. Where do I check?
util-linux (2.32-0.4) unstable; urgency=medium

The util-linux implementation of /bin/su is now used, replacing the
one previously supplied by src:shadow (shipped in login package), and
bringing Debian in line with other modern distributions. The two
implementations are very similar but have some minor differences (and
there might be more that was not yet noticed ofcourse), e.g.

- new 'su' (with no args, i.e. when preserving the environment) also
preserves PATH and IFS, while old su would always reset PATH and IFS
even in 'preserve environment' mode.
- su '' (empty user string) used to give root, but now returns an error.
- previously su only had one pam config, but now 'su -' is configured
separately in /etc/pam.d/su-l

The first difference is probably the most user visible one. Doing
plain 'su' is a really bad idea for many reasons, so using 'su -' is
strongly recommended to always get a newly set up environment similar
to a normal login. If you want to restore behaviour more similar to
the previous one you can add 'ALWAYS_SET_PATH yes' in /etc/login.defs.

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: 1605
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: 2696
Joined: 2009-06-28 06:09
Been thanked: 85 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