Substitute-User or Super-User ? (why 'su user' is useful)

Jerry Peek jerry at ora.com
Tue Jan 29 22:11:17 AEST 1991


In article <1991Jan26.173253.21396 at dg-rtp.dg.com> hunt at 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 at wheeze% jobs
	[1]    Stopped      su
	[2] +  Stopped      su bin
	[3] -  Stopped      su manuals
	jerry at wheeze% fg
	su bin
		...do stuff as bin...
	bin at wheeze% suspend
	Stopped
	jerry at wheeze% fg %1
	su
	wheeze#
		...do stuff as root...
	wheeze# suspend
	Stopped
	jerry at 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 at ora.com



More information about the Comp.unix.questions mailing list