Advertising

Author Topic: "su - root"  (Read 1878 times)

Offline paxmark1

  • Hero Member
  • *****
  • Posts: 625
"su - root"
« on: May 23, 2019, 08:26:31 pm »
short answer
"su root"     will  often give you problems.  "su - root"  (or any other user you are changing to) should cause no problems. 


I posted a time or two about something new in Debian and Sparky in November 2018, but it is buried in other things.
From the Debian Forum via apt-listchanges

Quote
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.

http://sparkylinux.org/forum/index.php/topic,4684.msg12022.html#msg12022
Quote
##  I reserve nimbler minds and nimbler tongues to explain. 


Don't make a FrankenDebian

Offline kanliot

  • Jr. Member
  • **
  • Posts: 77
Re: "su - root"
« Reply #1 on: May 24, 2019, 02:52:24 am »
thanks for this.   

have you noticed that starting gui apps, after you did su -, seems inconsistent?

for example


0. (created a symbolic link to .Xauthority)  from /root/.Xauthority -> /home/kanliot/.Xauthority 
1. su - #in guake (autostarted)
2. gparted #can't run
3. DISPLAY=:0 gparted #this works

« Last Edit: May 24, 2019, 03:00:16 am by kanliot »

Offline paxmark1

  • Hero Member
  • *****
  • Posts: 625
Re: "su - root"
« Reply #2 on: May 24, 2019, 06:19:01 pm »
I mostly just did (in past)  su root in terminal, fire up tmux and update, upgrade in one pane and start up the VPN in another.  Putting your openvpn into tmux means that if the terminal is shut down, the process continues.  After the change, upgrades went poorly until I went to   "su - root"  If I change in a terminal to someuser  I now do it via "su - someuser"

1.  I have not ever changed my .Xauthority
2.  For gparted, I always do as "sudo gparted"  (as you do not want to start root in a gui)  or via Alt-F2 - gparted and it asks for my users password
3.  Not tried. 

Just a hobbyist, I am good at relaying info. A little innoculation for the Sparky4's if they move to Buster.   Sidenote: 122 bugs to go presently for Buster to move to stable.   And subject lines like above will hopefully go into search engines for people to stumble upon the Sparky forum. 
https://bugs.debian.org/release-critical/other/testing.html         

peace out
Don't make a FrankenDebian

Offline kanliot

  • Jr. Member
  • **
  • Posts: 77
Re: "su - root"
« Reply #3 on: May 25, 2019, 09:46:12 pm »
I guess this is off topic, but when debian 10 is released, is there going to be any competition for Sparkylinux on Debian 10 derivatives?