The "new" su

What other apps and distros do you use to round out your studio?

Moderators: khz, MattKingUSA

User avatar
khz
Established Member
Posts: 1030
Joined: Thu Apr 17, 2008 6:29 am
Location: German

The "new" su

Postby khz » Tue May 14, 2019 5:02 am

When I did a Debian-testing upgrate "su" couldn't get the program names anymore .... (TAB key). After troubleshooting with a search engine of my choice I found the solution.
If I log in with "su -" it works as usual.

####

Using 'su' generates now an path error when launching programs such as 'shutdown'. The cause is a new behavior described below.
---
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.
---

The new 'su' is useless for me because it cannot launch root program.
I did the modification in /etc/login.defs and restore the previous
behavior. However I am concern with the statement " Doing plain 'su'
is a really bad idea for many reasons".

Source: https://lists.debian.org/debian-user/2018/08/msg00487.html
FZ - Does humor belongs in Music?
GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
    I don't care about the freedom of speech because I have nothing to say.

User avatar
Linuxmusician01
Established Member
Posts: 386
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: The "new" su

Postby Linuxmusician01 » Tue May 14, 2019 12:22 pm

Do you mean that if you simply use the command "su" without options (to switch to user 'root') that it follows the path of the previous user (i.e. the path variable from /home/my_user_name/)? Do you mean that you must switch to 'root' with the option "-" like so: "su -" for the path to be root's path so it can find commands like "shutdown" etc.?

User avatar
khz
Established Member
Posts: 1030
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Re: The "new" su

Postby khz » Tue May 14, 2019 12:32 pm

Technically, I can't explain it because I don't know exactly. With the normal "su" I could no longer use the tab key to automatically complete program names or a path.

The "su -" is a BSD function?
FZ - Does humor belongs in Music?
GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
    I don't care about the freedom of speech because I have nothing to say.

merlyn
Established Member
Posts: 293
Joined: Thu Oct 11, 2018 4:13 pm

Re: The "new" su

Postby merlyn » Wed May 15, 2019 11:39 am

If you use su without options it only reads the new user's .bashrc

If you use su - it reads .bash_profile.

User avatar
Linuxmusician01
Established Member
Posts: 386
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: The "new" su

Postby Linuxmusician01 » Wed May 15, 2019 11:56 am

merlyn wrote:If you use su without options it only reads the new user's .bashrc

If you use su - it reads .bash_profile.

What's the difference between those two? Never knew .bash_profile existed...

merlyn
Established Member
Posts: 293
Joined: Thu Oct 11, 2018 4:13 pm

Re: The "new" su

Postby merlyn » Wed May 15, 2019 1:17 pm

You might not have one. It may be that your system uses the defaults. You could find out with

Code: Select all

sudo find / -name .bash_profile


Return to “Linux Distributions & Other Software”

Who is online

Users browsing this forum: No registered users and 2 guests