Bug 682726 - Reference suggests only "su" instead of "su -"/su -l/su --login "make the shell a login shell"
Summary: Reference suggests only "su" instead of "su -"/su -l/su --login "make the she...
Status: RESOLVED WONTFIX
Alias: None
Product: openSUSE 11.4
Classification: openSUSE
Component: Documentation (show other bugs)
Version: Final
Hardware: Other Other
: P5 - None : Major with 2 votes (vote)
Target Milestone: ---
Assignee: Tanja Roth
QA Contact: Karl Eichwalder
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-25 17:08 UTC by Martin Seidler
Modified: 2017-08-11 20:12 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Seidler 2011-03-25 17:08:08 UTC
User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:2.0.0) Gecko/20100101 Firefox/4.0

The manual "Referece" describes only to get superuser privileges without really becoming root (without using a login shell or an equivalent). So the user will get root rights without using the environment of the user root.

Reproducible: Always

Steps to Reproduce:
1. Open the documentation/Manual "Reference" http://doc.opensuse.org/products/opensuse/openSUSE/opensuse-reference
2. Go to
Reference > Chapter 21. Shell Basics > 21.4. Becoming Root > 21.4.1.
Using su
http://doc.opensuse.org/products/opensuse/openSUSE/opensuse-reference/cha.new.bash.html#sec.new.bash.root
3. Read
Actual Results:  
"su"
The procedure of getting superuser privileges but not logging in as superuser actual is described:

[CITE]
 21.4.1. Using su¶

 In order to temporarily become root in a shell, proceed as follows:

  1.   Enter su. You are prompted for the root password.

  2.  Enter the password. If you mistyped the root password, the shell displays a message. In this case, you have to re-enter su before retyping the password. If your password is correct, a hash symbol # appears at the end of the prompt, signaling that you are acting as root now. 
 [...]
 [/CITE]

Expected Results:  
"su -"="su -l"="su -login" should be described.
The procedure of getting superuser privileges and simultaneous logging in as root with root's enviorment should be described.

In addition a warning before using only "su" might be appropriate.

See also:

Vincent Untz
Re: [opensuse-factory] Trouble starting yast2 from terminal
Date: Thu, 10 Mar 2011 10:47:34 +0100
Message-id: <20110310094734.GC27272@vuntz.net> 
http://lists.opensuse.org/opensuse-factory/2011-03/msg00298.html
[CITE]
Use "su -", not "su". I'm actively wondering if there's any reason to
keep the "su" default behavior around. It just keeps harming us again
and again.
[/CITE]

Guido Berhörster
Bug 655751 - gdbus aborting due to unauthorized socket in DBUS_SESSION_BUS_ADDRESS
Comment 10 of that thread
2011-03-17 18:51:17 UTC
[CITE](In reply to comment #9)
> You are right.  I wasn't using "-" before.  I tested it and it worked.  While I
> k now that is the standard way of doing things, previous versions of Suse
> didn't require it--made me lazy I guess.

You shouldn't do that, GNU coreutils su has in contrast to other
implementations like Solaris su no security precautions at all and if you don't
request a login shell, $PATH and any $LD_* variables are happily passed along.
But this is getting offtopic, this bug is about glib not handling an invalid
$DBUS_SESSION_BUS_ADDRESS gracefully.

[/CITE]

SDB:Login as root
 # A longer terminal session as root
http://en.opensuse.org/SDB:Login_as_root#A_longer_terminal_session_as_root

http://en.wikipedia.org/wiki/Su_%28Unix%29#Usage
[CITE][...]It should generally be used with a hyphen by administrators (su -, which is identical to su - root), which can be used to start a login shell. This way users can assume the user environment of the target user:[..]
[/CITE]

Because of that I presume the Serverity Major is appropriate.
Comment 1 Martin Seidler 2011-03-25 17:32:50 UTC
P.S. See also:
Thread: Become su in Terminal - HowTo
http://forums.opensuse.org/forums/english/get-technical-help-here/how-faq-forums/unreviewed-how-faq/424498-become-su-terminal-howto.html with further references and example of caused failures by the use of "su" without the additional login argument.
Comment 2 Tanja Roth 2011-04-04 09:44:06 UTC
Thanks for the report, I see your point. 

Initially, this snippet was part of a chapter dedicated to newbies where I didn't want to go into any details regarding environment variables -- that's why I did not mention su - there. But I will change this for the future.
Comment 3 Martin Seidler 2011-04-04 15:43:33 UTC
(In reply to comment #2)
> Thanks for the report, I see your point. 
> 
> Initially, this snippet was part of a chapter dedicated to newbies where I
> didn't want to go into any details regarding environment variables -- that's
> why I did not mention su - there. But I will change this for the future.
Thanks for becoming assignee of this bug, Tanja.

A explanation *why* to use su better with a login would be fine
but I think that other thing may be an "Enhancement" not a real (Major) bug.

Regards
Martin
Comment 4 Nathan Cutler 2017-08-11 20:12:30 UTC
I couldn't find that chapter in the current (openSUSE Leap 42.3) Reference Guide. Also, basic Linux command-line usage is out-of-scope for that document.