1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
'\" te
.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common
.\" Development and Distribution License (the "License"). You may not use this
.\" file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or
.\" http://www.opensolaris.org/os/licensing. See the License for the specific
.\" language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and
.\" include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable,
.\" add the following below this CDDL HEADER, with the fields enclosed by
.\" brackets "[]" replaced with your own identifying information:
.\" Portions Copyright [yyyy] [name of copyright owner]
.\" Copyright 2013 DEY Storage Systems, Inc.
.\" Copyright (c) 2014 Gary Mills
.\" Copyright (c) 2015, Joyent, Inc. All Rights Reserved
.\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
.TH ZLOGIN 1 "Mar 30, 2015"
.SH NAME
zlogin \- enter a zone
.SH SYNOPSIS
.LP
.nf
\fBzlogin\fR [\fB-dCEINQ\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR
.fi
.LP
.nf
\fBzlogin\fR [\fB-inEQS\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR \fIutility\fR
[\fIargument\fR]...
.fi
.SH DESCRIPTION
.LP
The \fBzlogin\fR utility is used by the administrator to enter an operating
system zone. Only a superuser operating in the global system zone can use this
utility.
.sp
.LP
\fBzlogin\fR operates in one of four modes:
.sp
.ne 2
.na
\fBInteractive Mode\fR
.ad
.RS 24n
If no utility argument is given or if the \fB-i\fR option is specified, and the
stdin file descriptor for the \fBzlogin\fR process is a tty device, \fBzlogin\fR
operates in \fBinteractive mode\fR. In this mode, \fBzlogin\fR creates a new
pseudo terminal for use within the login session. Programs requiring a tty
device, for example, \fBvi\fR(1), work properly in this mode. In this mode,
\fBzlogin\fR invokes \fBlogin\fR(1) to provide a suitable login session.
.RE
.sp
.ne 2
.na
\fBNon-Interactive Mode\fR
.ad
.RS 24n
If a utility is specified and the \fB-i\fR option is not specified, \fBzlogin\fR
operates in \fBnon-interactive mode\fR. This mode can be useful for script
authors since stdin, stdout, and stderr are preserved and the exit status of
\fIutility\fR is returned upon termination. In this mode, \fBzlogin\fR invokes
\fBsu\fR(8) in order to set up the user's environment and to provide a login
environment.
.sp
The specified command is passed as a string and interpreted by a shell running
in the non-global zone. See \fBrsh\fR(1).
.RE
.sp
.ne 2
.na
\fBConsole Mode\fR
.ad
.RS 24n
If the \fB-C\fR option is specified, the user is connected to the zone console
device and \fBzlogin\fR operates in \fBconsole mode\fR. The zone console is
available once the zone is in the installed state. Connections to the console
are persistent across reboot of the zone.
.RE
.sp
.ne 2
.na
\fBStandalone-processs Interactive Mode\fR
.ad
.RS 24n
If the \fB-I\fR option is specified the user is connected to the zone's stdin,
stdout and stderr \fBzfd(7D)\fR devices.
.RE
.SH OPTIONS
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-C\fR\fR
.ad
.RS 15n
Connects to the zone console.
.RE
.sp
.ne 2
.na
\fB\fB-d\fR\fR
.ad
.RS 15n
Disconnect from the console when the zone halts. This option may only be used
if the \fB-C\fR option is specified.
.RE
.sp
.ne 2
.na
\fB\fB-e\fR \fIc\fR\fR
.ad
.RS 15n
Specifies a different escape character, \fIc\fR, for the key sequence used to
access extended functions and to disconnect from the login. The default escape
character is the tilde (\fB~\fR).
.RE
.sp
.ne 2
.na
\fB\fB-E\fR\fR
.ad
.RS 15n
Disables the ability to access extended functions or to disconnect from the
login by using the escape sequence character.
.RE
.sp
.ne 2
.na
\fB\fB-i\fR\fR
.ad
.RS 15n
Forces interactive mode when a utility argument is specified.
.RE
.sp
.ne 2
.na
\fB\fB-I\fR\fR
.ad
.RS 15n
Connects to the zone's \fBzfd(7D)\fR devices.
.RE
.sp
.sp
.ne 2
.na
\fB\fB-l\fR \fIusername\fR\fR
.ad
.RS 15n
Specifies a different \fIusername\fR for the zone login. If you do not use this
option, the zone username used is "root". This option is invalid if the
\fB-C\fR option is specified.
.RE
.sp
.ne 2
.na
\fB-n\fR
.ad
.RS 15n
Redirect the input of \fBzlogin\fR to \fB/dev/null\fR.
This option is useful when the command running in the local zone
and the shell which invokes \fBzlogin\fR both read from standard input.
.RE
.sp
.ne 2
.na
\fB-N\fR
.ad
.RS 15n
Nohup. This may only be used with the -I option to avoid sending EOF to the zfd
device when zlogin's stdin receives EOF. It can also be toggled by sending
\fBSIGUSR1\fR to an attached zlogin process.
.RE
.sp
.ne 2
.na
\fB-Q\fR
.ad
.RS 15n
Specifies quiet mode operation. In quiet mode, extra messages indicating the
the function of \fBzlogin\fR will not be displayed, giving the possibility
to present the appearance that the command is running locally rather than
in another zone.
.RE
.sp
.ne 2
.na
\fB\fB-S\fR\fR
.ad
.RS 15n
"Safe" login mode. \fBzlogin\fR does minimal processing and does not invoke
\fBlogin\fR(1) or \fBsu\fR(8). The \fB-S\fR option can not be used if a
username is specified through the \fB-l\fR option, and cannot be used with
console logins. This mode should only be used to recover a damaged zone when
other forms of login have become impossible.
.RE
.SS "Escape Sequences"
.LP
Lines that you type that start with the tilde character (\fB~\fR) are "escape
sequences". The escape character can be changed using the \fB-e\fR option.
.sp
.ne 2
.na
\fB\fB~.\fR\fR
.ad
.RS 6n
Disconnects from the zone. This is not the same as a logout, because the local
host breaks the connection with no warning to the zone's end.
.RE
.SH SECURITY
.LP
Once a process has been placed in a zone other than the global zone, the
process cannot change zone again, nor can any of its children.
.SH OPERANDS
.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIzonename\fR\fR
.ad
.RS 15n
The name of the zone to be entered.
.RE
.sp
.ne 2
.na
\fB\fIutility\fR\fR
.ad
.RS 15n
The utility to be run in the specified zone.
.RE
.sp
.ne 2
.na
\fB\fIargument...\fR\fR
.ad
.RS 15n
Arguments passed to the utility.
.RE
.SH EXIT STATUS
.LP
In interactive and non-interactive modes, the \fBzlogin\fR utility exits when
the command or shell in the non-global zone exits. In non-interactive mode, the
exit status of the remote program is returned as the exit status of
\fBzlogin\fR. In interactive mode and console login mode, the exit status is
not returned. \fBzlogin\fR returns a \fB0\fR exit status as long as no
connection-related error occurred.
.sp
.LP
In all modes, in the event that a connection to the zone cannot be established,
the connection fails unexpectedly, or the user is lacking sufficient privilege
to perform the requested operation, \fBzlogin\fR exits with status \fB1\fR.
.sp
.LP
To summarize, the following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 7n
Successful entry.
.RE
.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.RS 7n
Permission denied, or failure to enter the zone.
.RE
.sp
.ne 2
.na
\fBAny\fR
.ad
.RS 7n
Return code from utility, or from \fBsu\fR(8) if operating in non-interactive
mode.
.RE
.SH ATTRIBUTES
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability Evolving
.TE
.SH SEE ALSO
.LP
.BR login (1),
.BR rsh (1),
.BR vi (1),
.BR attributes (7),
.BR zones (7),
.BR su (8),
.BR zoneadm (8),
.BR zonecfg (8)
.SH NOTES
.LP
\fBzlogin\fR fails if its open files or any portion of its address space
corresponds to an NFS file. This includes the executable itself or the shared
libraries.
|