su on buster, is this normal now?

News and discussion about development of the Debian OS itself

su on buster, is this normal now?

Postby kanliot » 2019-04-23 16:01

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?
kanliot
 
Posts: 36
Joined: 2013-09-02 08:00

Re: su on buster, is this normal now?

Postby Head_on_a_Stick » 2019-04-23 16:07

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.
User avatar
Head_on_a_Stick
 
Posts: 10321
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: su on buster, is this normal now?

Postby GarryRicketson » 2019-04-23 16:27

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: 5877
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: su on buster, is this normal now?

Postby GarryRicketson » 2019-04-23 16:40

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.
User avatar
GarryRicketson
 
Posts: 5877
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: su on buster, is this normal now?

Postby reinob » 2019-04-23 19:17

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 -.
reinob
 
Posts: 699
Joined: 2014-06-30 11:42

Re: su on buster, is this normal now?

Postby GarryRicketson » 2019-04-23 19:21

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.
User avatar
GarryRicketson
 
Posts: 5877
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: su on buster, is this normal now?

Postby kanliot » 2019-04-23 19:31

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.
kanliot
 
Posts: 36
Joined: 2013-09-02 08:00

Re: su on buster, is this normal now?

Postby GarryRicketson » 2019-04-23 20:02

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: 5877
Joined: 2015-01-20 22:16
Location: Durango, Mexico


Re: su on buster, is this normal now?

Postby GarryRicketson » 2019-04-23 21:52

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,
User avatar
GarryRicketson
 
Posts: 5877
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: su on buster, is this normal now?

Postby pcalvert » 2019-04-24 01:28

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

Phil
“Property is the fruit of labor; property is desirable; it is a positive good
in the world. That some should be rich shows that others may become
rich, and hence is just encouragement to industry and enterprise.”
— Abraham Lincoln
pcalvert
 
Posts: 1841
Joined: 2006-04-21 11:19
Location: Sol Sector

Re: su on buster, is this normal now?

Postby reinob » 2019-04-24 09:01

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.
reinob
 
Posts: 699
Joined: 2014-06-30 11:42

Re: su on buster, is this normal now?

Postby p.H » 2019-04-24 12:10

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.
p.H
 
Posts: 1011
Joined: 2017-09-17 07:12

Re: su on buster, is this normal now?

Postby kanliot » 2019-05-22 17:35

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?
kanliot
 
Posts: 36
Joined: 2013-09-02 08:00

Re: su on buster, is this normal now?

Postby 4D696B65 » 2019-05-22 17:41

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
4D696B65
 
Posts: 2406
Joined: 2009-06-28 06:09

Next

Return to Debian Development

Who is online

Users browsing this forum: No registered users and 1 guest

fashionable