[comp.unix.questions] Substitute-User or Super-User ?

ramakris@bloss.cs.vt.edu (S Ramakrishnan) (01/26/91)

I always thought 'su'  was a 'substitute user' command. Its seems
apt also, since it allows the current USER to be changed to the
specified user-id. Of course, default value of this parameter is
root.

That being so, why do so many reputed (?) shell programming books 
describe 'su' as 'super user' command  ('becoming a super user -- su').
Was it originally meant to be become-superuser command ?

--
    S.Ramakrishnan, CS Dept, McBryde Hall, VaTech, Blacksburg, Virg. 24061-0106
     (Email : Internet : ramakris@bloss.cs.vt.edu )
     (            UUCP : padma@topsy.UUCP         )

hunt@dg-rtp.rtp.dg.com (Greg Hunt) (01/27/91)

In article <868@creatures.cs.vt.edu>, ramakris@bloss.cs.vt.edu (S Ramakrishnan) writes:
> I always thought 'su'  was a 'substitute user' command. Its seems
> apt also, since it allows the current USER to be changed to the
> specified user-id. Of course, default value of this parameter is
> root.
> 
> That being so, why do so many reputed (?) shell programming books 
> describe 'su' as 'super user' command  ('becoming a super user -- su').
> Was it originally meant to be become-superuser command ?

It's because the default operation of su, as you mention, is to become
root, who is the super user.  Using the su command to become the
super user is more common, in my opinion, than using it to become
another user.  That's my understanding of the origin of the name.

The man page for my system says "su - become super-user or another
user", which is clearer than what you listed from your man page.

"Super user" is defined as having a user-id of zero.  Both root and
sysadm usually have a user-id of zero, so both user names have 
super user privileges.

Also, su doesn't change the current "user" as you mention.  Rather, it
starts a new shell with the specified user name.  When you exit this
new shell, you're back running your original shell.  At least, that's
the way it works on my system.

Hope this helps.  Enjoy!

-- 
Greg Hunt                        Internet: hunt@dg-rtp.rtp.dg.com
DG/UX Kernel Development         UUCP:     {world}!mcnc!rti!dg-rtp!hunt
Data General Corporation
Research Triangle Park, NC, USA  These opinions are mine, not DG's.

guy@auspex.auspex.com (Guy Harris) (01/27/91)

>> Was it originally meant to be become-superuser command ?
>
>It's because the default operation of su, as you mention, is to become
>root, who is the super user.

And because, as I remember, the V6 version *only* let you become
super-user; it didn't take an optional "who should I become" argument. 
Back then, it *was* the "super user" command; I guess when they added
the user-name argument, they came up with "substitute user" as the best,
well, umm, what *is* the name for a phrase formed from an acronym? :-)

(Remember, the etymology of UNIX commands is, at times, quirky. 
Consider V6's "dsw" command - no, it's not "Department of Sanitary
Waste", nor is it roughly based on "Do Svidanja".)

cornett@seattle.crd.ge.com (dan cornett) (01/28/91)

The "su" does not stand for super-user; this meaning is given it by those
who do not have experience with UNIX. "substitute user" is close to the
meaning: "set user" or "set userid" (I saw both used in the earliy 80's,
but I no longer have the old man pages, so I have forgotten which was the
"official" meaning.)

The optional userid argument is of main use to root.  Root can su to any
other user without knowing the password; this facilitates helping other
users when the system operator is working as root and one of the system
users says "such and such isn't working in my account."

Side note: this is why root and system operators should make "." the last
directory searched (or better, do not include "." in the search path). su has
been the source of many Trojan horse attacks by users who ask for "help"
which requires an su.

Danny

mike@wang.com (Mike Sullivan) (01/29/91)

su stands for Set-User


-- 
  ________________________
 /                    __  \  | Michael J. Sullivan    |ec.lec.tic adj Choosing
| \  \  /  /\  |\ |  /  `  | | Wang Laboratories Inc. |or consisting of what 
|  \/ \/  /--\ | \|  \__T  | | mike@WANG.COM	      |appears to be the best 
 \________________________/  | 			      |from diverse sources.

skwu@spot.Colorado.EDU (WU SHI-KUEI) (01/29/91)

My V7 manual reads:

	su - substitute user id temporarily

System III and later:

	su - become super-user or another user

You takes your choice or makes a pick (:-)

jerry@ora.com (Jerry Peek) (01/29/91)

In article <1991Jan26.173253.21396@dg-rtp.dg.com> hunt@dg-rtp.rtp.dg.com writes:
> ...Using the su command to become the
> super user is more common, in my opinion, than using it to become
> another user.  That's my understanding of the origin of the name.

BTW, here's why I use "su user" a lot.  I think it's really handy:

- I want shells open onto several other accounts.  My system has job
  control, so I can suspend the "su user" shells and jump back to them
  whenever I want:

	jerry@wheeze% jobs
	[1]    Stopped      su
	[2] +  Stopped      su bin
	[3] -  Stopped      su manuals
	jerry@wheeze% fg
	su bin
		...do stuff as bin...
	bin@wheeze% suspend
	Stopped
	jerry@wheeze% fg %1
	su
	wheeze#
		...do stuff as root...
	wheeze# suspend
	Stopped
	jerry@wheeze%

- Because these shells run on the same tty as your login shell, "su"
  doesn't tie up other tty/pty ports like multiple logins or multiple
  windows can.  This is a help on busy machines with lots of users.

The thing to watch out for is that plain "su user" doesn't read a csh
user's .login file or sh user's .profile.  Using "su - user" solves that,
but you can't suspend an "su -" shell (at least not on my systems).

--Jerry Peek, jerry@ora.com

cdl@chiton.ucsd.edu (Carl Lowenstein) (01/31/91)

In article <1991Jan29.182919.24062@dg-rtp.dg.com> goudreau@larrybud.rtp.dg.com (Bob Goudreau) writes:
>
>Anyone know what the v6 or v7 man pages said?

Ok, already.  I just went to the back bookshelf and found:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

SU(VIII)			10/31/73			SU(VIII)

NAME
	su -- become privileged user

SYNOPSIS
	su

DESCRIPTION
	Su allows one to become the super-user, who has all sorts of
	marvelous (and correspondingly dangerous) powers.  . . .

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
-- 
        carl lowenstein         marine physical lab     u.c. san diego
        {decvax|ucbvax} !ucsd!mpl!cdl                 cdl@mpl.ucsd.edu
                                                  clowenstein@ucsd.edu

dmturne@PacBell.COM (Dave Turner) (01/31/91)

In article <1991Jan29.182919.24062@dg-rtp.dg.com> goudreau@larrybud.rtp.dg.com (Bob Goudreau) writes:
>Anyone know what the v6 or v7 man pages said?

The UNIX Programmer's Manual Sixth Edition (by Thompson and Ritchie),
May, 1975 says on man page:

	su(VIII)
		su - become privileged user

The UNIX User's Manual Release 3.0 (based on the UPM Seventh Edition),
June, 1980 says on man page:

	su(1)
		su - become super-user or another user


The old manuals were more fun to read. For su in the sixth edition it says:

	"Su allows one to become the super-user, who has all sorts of
	marvelous (and correspondingly dangerous) powers."


-- 
Dave Turner	415/823-2001	{att,bellcore,sun,ames,decwrl}!pacbell!dmturne

scjones@thor.UUCP (Larry Jones) (01/31/91)

In article <1991Jan29.182919.24062@dg-rtp.dg.com>, goudreau@larrybud.rtp.dg.com (Bob Goudreau) writes:
> The "substitute user" phrase might be Berkeley-derived; both the
> 4.2 and 4.3 BSD man pages summarize the command as "su -- substitute
> user id temporarily".
> 
> Anyone know what the v6 or v7 man pages said?

My v7 man page says "substitute user id temporarily".
----
Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
Domain: scjones@thor.UUCP  Path: uunet!sdrc!thor!scjones
My life needs a rewind/erase button. -- Calvin

rbj@uunet.UU.NET (Root Boy Jim) (02/01/91)

In article <687@chiton.ucsd.edu> cdl@chiton (Carl Lowenstein) writes:
?In article <1991Jan29.182919.24062@dg-rtp.dg.com> goudreau@larrybud.rtp.dg.com (Bob Goudreau) writes:
?>
?>Anyone know what the v6 or v7 man pages said?
?
?Ok, already.  I just went to the back bookshelf and found:

Presumably from the Sixth Edition (V6).

?- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
?
?SU(VIII)			10/31/73			SU(VIII)
?
?NAME
?	su -- become privileged user
?
?SYNOPSIS
?	su
?
?DESCRIPTION
?	Su allows one to become the super-user, who has all sorts of
?	marvelous (and correspondingly dangerous) powers.  . . .
?
?- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

Well, I have a Fifth Edition manual. It has the same date and
the exact text listed above, except that it is in section I, not VIII.

The Preface says the number of installations in "now above 50".
-- 

	Root Boy Jim Cottrell <rbj@uunet.uu.net>
	Close the gap of the dark year in between