add 1994 copyright
[unix-history] / usr / src / usr.bin / su / su.1
CommitLineData
84bb5642
KB
1.\" Copyright (c) 1988, 1990, 1993
2.\" The Regents of the University of California. All rights reserved.
7d4168b6 3.\"
c2d1dc9f 4.\" %sccs.include.redist.roff%
6964f298 5.\"
84bb5642 6.\" @(#)su.1 8.1 (Berkeley) %G%
7d4168b6 7.\"
27655ae5
CL
8.Dd
9.Dt SU 1
c2d1dc9f 10.Os
27655ae5
CL
11.Sh NAME
12.Nm su
13.Nd substitute user identity
14.Sh SYNOPSIS
15.Nm su
16.Op Fl Kflm
17.Op Ar login
18.Sh DESCRIPTION
19.Nm Su
e5b1d5e7 20requests the Kerberos password for
27655ae5
CL
21.Ar login
22(or for
23.Dq Ar login Ns .root ,
24if no login is provided), and switches to
239627de 25that user and group ID after obtaining a Kerberos ticket granting ticket.
27655ae5
CL
26A shell is then executed.
27.Nm Su
e5b1d5e7 28will resort to the local password file to find the password for
27655ae5 29.Ar login
e5b1d5e7 30if there is a Kerberos error.
239627de 31If
27655ae5 32.Nm su
239627de 33is executed by root, no password is requested and a shell
27655ae5 34with the appropriate user ID is executed; no additional Kerberos tickets
239627de 35are obtained.
27655ae5 36.Pp
e5b1d5e7 37By default, the environment is unmodified with the exception of
27655ae5
CL
38.Ev USER ,
39.Ev HOME ,
e5b1d5e7 40and
27655ae5
CL
41.Ev SHELL .
42.Ev HOME
e5b1d5e7 43and
27655ae5 44.Ev SHELL
e5b1d5e7 45are set to the target login's default values.
27655ae5 46.Ev USER
e5b1d5e7
KB
47is set to the target login, unless the target login has a user ID of 0,
48in which case it is unmodified.
49The invoked shell is the target login's.
50This is the traditional behavior of
27655ae5
CL
51.Nm su .
52.Pp
e5b1d5e7 53The options are as follows:
27655ae5
CL
54.Bl -tag -width Ds
55.It Fl K
e5b1d5e7 56Do not attempt to use Kerberos to authenticate the user.
27655ae5 57.It Fl f
e5b1d5e7 58If the invoked shell is
27655ae5
CL
59.Xr csh 1 ,
60this option prevents it from reading the
61.Dq Pa .cshrc
62file.
63.It Fl l
e5b1d5e7
KB
64Simulate a full login.
65The environment is discarded except for
27655ae5
CL
66.Ev HOME ,
67.Ev SHELL ,
68.Ev PATH ,
69.Ev TERM ,
e5b1d5e7 70and
27655ae5
CL
71.Ev USER .
72.Ev HOME
e5b1d5e7 73and
27655ae5 74.Ev SHELL
e5b1d5e7 75are modified as above.
27655ae5 76.Ev USER
e5b1d5e7 77is set to the target login.
27655ae5
CL
78.Ev PATH
79is set to
80.Dq Pa /bin:/usr/bin .
81.Ev TERM
e5b1d5e7
KB
82is imported from your current environment.
83The invoked shell is the target login's, and
27655ae5 84.Nm su
e5b1d5e7 85will change directory to the target login's home directory.
27655ae5 86.It Fl m
e5b1d5e7
KB
87Leave the environment unmodified.
88The invoked shell is your login shell, and no directory changes are made.
89As a security precaution, if the target user's shell is a non-standard
27655ae5
CL
90shell (as defined by
91.Xr getusershell 3 )
92and the caller's real uid is
6fad2abb 93non-zero,
27655ae5 94.Nm su
6fad2abb 95will fail.
27655ae5
CL
96.El
97.Pp
98The
99.Fl l
100and
101.Fl m
102options are mutually exclusive; the last one specified
e5b1d5e7 103overrides any previous ones.
27655ae5
CL
104.Pp
105Only users in group 0 (normally
106.Dq wheel )
107can
108.Nm su
109to
110.Dq root .
111.Pp
6964f298 112By default (unless the prompt is reset by a startup file) the super-user
27655ae5
CL
113prompt is set to
114.Dq Sy \&#
115to remind one of its awesome power.
116.Sh SEE ALSO
117.Xr csh 1 ,
118.Xr login 1 ,
119.Xr sh 1 ,
120.Xr kinit 1 ,
121.Xr kerberos 1 ,
122.Xr passwd 5 ,
123.Xr group 5 ,
124.Xr environ 7
125.Sh ENVIRONMENT
126Environment variables used by
127.Nm su :
128.Bl -tag -width HOME
129.It Ev HOME
130Default home directory of real user ID unless modified as
131specified above.
132.It Ev PATH
133Default search path of real user ID unless modified as specified above.
134.It Ev TERM
135Provides terminal type which may be retained for the substituted
136user ID.
137.It Ev USER
138The user ID is always the effective ID (the target user ID) after an
139.Nm su
140unless the user ID is 0 (root).
141.El
142.Sh HISTORY
143A
144.Nm
145command appeared in
146.At v7 .
147The version desribed
c2d1dc9f
CL
148here is an adaptation of the
149.Tn MIT
150Athena Kerberos command.