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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
|
'\" te
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Right Reserved.
.\" Copyright 2018 Nexenta Systems, Inc. All rights reserved.
.\" Portions Copyright 1994-2008 The FreeBSD Project. All rights reserved.
.\" Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
.\" disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.TH SMBUTIL 1 "Apr 11, 2018"
.SH NAME
smbutil \- Solaris CIFS client utility
.SH SYNOPSIS
.LP
.nf
\fB/usr/bin/smbutil crypt\fR
.fi
.LP
.nf
\fB/usr/bin/smbutil discon //[\fIdomain\fR;][\fIuser\fR@]\fIserver\fR\fR
.fi
.LP
.nf
\fB/usr/bin/smbutil login [-c] [[\fIdomain\fR/]\fIuser\fR]\fR
.fi
.LP
.nf
\fB/usr/bin/smbutil login [-c] [\fIuser\fR[@\fIdomain\fR]]\fR
.fi
.LP
.nf
\fB/usr/bin/smbutil logout [[\fIdomain\fR/]\fIuser\fR]\fR
.fi
.LP
.nf
\fB/usr/bin/smbutil logout [\fIuser\fR[@\fIdomain\fR]]\fR
.fi
.LP
.nf
\fB/usr/bin/smbutil logout -a\fR
.fi
.LP
.nf
\fB/usr/bin/smbutil logoutall\fR
.fi
.LP
.nf
\fB/usr/bin/smbutil lookup \fIname\fR\fR
.fi
.LP
.nf
\fB/usr/bin/smbutil status \fIserver\fR\fR
.fi
.LP
.nf
\fB/usr/bin/smbutil view [-A | -U \fIuser\fR] //[\fIdomain\fR;][\fIuser\fR[:\fIpassword\fR]@]\fIserver\fR\fR
.fi
.LP
.nf
\fB/usr/bin/smbutil [\fB-?dv\fR]\fR
.fi
.SH DESCRIPTION
.LP
The \fBsmbutil\fR command controls the Solaris CIFS client and issues various
commands.
.SS "Subcommands"
.LP
The \fBsmbutil\fR command supports the following subcommands:
.sp
.ne 2
.na
\fB\fBcrypt\fR\fR
.ad
.sp .6
.RS 4n
Creates a hash of a password. This subcommand prompts for a password and writes
the hash to standard output. This hash value is suitable for use as a value for
the \fBpassword\fR property in the \fB$HOME/.nsmbrc\fR file.
.sp
The hashed password begins with two dollar signs (\fB$$\fR). If you assign this
hashed password to the \fBpassword\fR property in your \fB$HOME/.nsmbrc\fR, be
sure that you escape the special characters in the password.
.sp
If you plan to store hashed passwords in your \fB$HOME/.nsmbrc\fR file, ensure
that the file permissions are set so that only the owner can read or write the
file (\fB400\fR or \fB600\fR), or the passwords are ignored.
.RE
.sp
.ne 2
.na
\fB\fBdiscon -U \fIuser\fR]
//[\fIdomain\fR;][\fIuser\fR\fIserver\fR\fR\fR
.ad
.sp .6
.RS 4n
Disconnects the specified SMB session to \fIserver\fR.
Usage is similar to the \fB\fBview\fR\fR subcommand.
This subcommand is primarily for use in tests.
.RE
.sp
.ne 2
.na
\fB\fBlogin [-c] [ [[\fIdomain\fR/]\fIuser\fR] | [\fIuser\fR[@\fIdomain\fR]
]\fR\fR
.ad
.sp .6
.RS 4n
Specifies persistent password information to be used for a CIFS server user
account. When you specify this information, mounts can be done without a
password prompt in non-Kerberos configurations. Kerberos sites should use
Kerberos automatically, not prompt for a password. If a default domain is
available in SMF or \fBnsmbrc\fR(4), the domain can be omitted. If a user name
is not specified, the Solaris user account name is used.
.sp
Use the \fB-c\fR to check whether a persistent password is set for the
specified user.
.sp
Passwords can also be stored for a specific server by using a server name in
place of the domain name. This capability is useful with servers that are
configured for "workgroup mode."
.RE
.sp
.ne 2
.na
\fB\fBlogout [ [[\fIdomain\fR/]\fIuser\fR] | [\fIuser\fR[@\fIdomain\fR] ]\fR\fR
.ad
.sp .6
.RS 4n
Erases the persistent passwords for the user running the command.
.sp
The user name and domain name portions of the name are optional. If these names
are not specified, the user name and domain name values are taken from the
properties set in your environment. See the \fBnsmbrc\fR(4) manual page.
.sp
If you stored your password for a specific server, specify the server name in
place of the domain name.
.RE
.sp
.ne 2
.na
\fB\fBlogout -a\fR\fR
.ad
.sp .6
.RS 4n
Erases all of the persistent passwords that are stored for the user who is
running the command.
.RE
.sp
.ne 2
.na
\fB\fBlogoutall\fR\fR
.ad
.sp .6
.RS 4n
Erases all the persistent passwords that are stored by all users running the
\fBsmbutil login\fR command.
.sp
This command must be run as superuser.
.RE
.sp
.ne 2
.na
\fB\fBlookup \fIname\fR\fR\fR
.ad
.sp .6
.RS 4n
Resolves the specified \fIname\fR to an IP address.
.sp
This subcommand is only supported if an NBNS/WINS name server is available.
.RE
.sp
.ne 2
.na
\fB\fBstatus \fIserver\fR\fR\fR
.ad
.sp .6
.RS 4n
Resolves the specified server to the NetBIOS domain and system name.
\fIserver\fR can be an IP address or a DNS name.
.RE
.sp
.ne 2
.na
\fB\fBview [-A | -U \fIuser\fR]
//[\fIdomain\fR;][\fIuser\fR[:\fIpassword\fR]@]\fIserver\fR\fR\fR
.ad
.sp .6
.RS 4n
Lists the resources available to \fIuser\fR on the specified \fIserver\fR.
.sp
You can specify the \fB-A\fR option to view the resources as an anonymous user
or the \fB-U\fR \fIuser\fR option to view the resources as the specified user.
These options are mutually exclusive.
.sp
If the resource includes a domain, you must escape the semicolon that appears
after the domain name to prevent it from being interpreted by the command
shell. For instance, surround the entire resource name with single quotes:
\fBsmbutil view '//SALES;george@RSERVER'\fR.
.RE
.SH OPTIONS
.LP
The following global options are supported:
.sp
.ne 2
.na
\fB\fB-d\fR\fR
.ad
.RS 13n
Produces debugging output.
.RE
.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.RS 13n
Produces verbose output.
.RE
.sp
.ne 2
.na
\fB\fB-?\fR\fR
.ad
.RS 13n
Prints a short help message.
.RE
.SH EXAMPLES
.LP
\fBExample 1 \fRCreating a Password Hash for the \fB$HOME/.nsmbrc\fR File
.sp
.LP
The following example shows how to use the \fBsmbutil crypt\fR command to
create a hash of the password you specify. Then, you can use the hash as the
value for the \fB$HOME/.nsmbrc\fR file.
.sp
.LP
Be sure to escape the two dollar-sign prefix of the hashed password if you
store it as a value of the \fBpassword\fR property.
.sp
.in +2
.nf
$ \fBsmbutil crypt\fR
Password:
$$178465324253e0c07
.fi
.in -2
.sp
.sp
.LP
The following \fB$HOME/.nsmbrc\fR file fragment shows how the password hash
value is set:
.sp
.in +2
.nf
[RSERVER:george]
charsets=koi8-r:cp866
password='$$178465324253e0c07'
.fi
.in -2
.sp
.LP
\fBExample 2 \fRStoring a Password for a CIFS Server
.sp
.LP
The following example shows how to use the \fBsmbutil login\fR command to store
the \fBroot@example\fR user's password.
.sp
.in +2
.nf
$ \fBsmbutil login root@example\fR
Password:
.fi
.in -2
.sp
.LP
\fBExample 3 \fRErasing the Stored Password
.sp
.LP
The following example shows how to use the \fBsmbutil logout\fR command to
remove the \fBroot@example\fR user's password.
.sp
.in +2
.nf
$ \fBsmbutil logout root@example\fR
.fi
.in -2
.sp
.LP
\fBExample 4 \fRViewing Available Shares
.sp
.LP
The following example shows how to use the \fBsmbutil view\fR command to see
the available shares for user \fBroot\fR on server \fBexample\fR.
.sp
.in +2
.nf
$ \fBsmbutil view //root@example\fR
Password:
Share Type Comment
-------------------------------
netlogon disk Network Logon Service
ipc$ IPC IPC Service (Samba Server)
tmp disk Temporary file space
public disk Public Stuff
root disk Home Directories
5 shares listed from 5 available
.fi
.in -2
.sp
.LP
\fBExample 5 \fRViewing Available Shares as an Anonymous User
.sp
.LP
The following example shows how to use the \fBsmbutil view\fR command to
anonymously view the available shares on the \fBexample\fR server.
.sp
.in +2
.nf
$ \fBsmbutil view -A //example\fR
Share Type Comment
-------------------------------
netlogon disk Network Logon Service
ipc$ IPC IPC Service (Samba Server)
tmp disk Temporary file space
public disk Public Stuff
ethereal disk /export/ethereal
myshare disk Jan's stuff
6 shares listed from 6 available
.fi
.in -2
.sp
.LP
\fBExample 6 \fRObtaining the IP Address From a Server Name
.sp
.LP
The following example shows how to use the \fBsmbutil lookup\fR command to
obtain the IP address of the \fBexample\fR server.
.sp
.in +2
.nf
$ \fBsmbutil lookup example\fR
Got response from 192.168.168.210
IP address of example: 192.168.168.210
.fi
.in -2
.sp
.LP
\fBExample 7 \fRObtaining the NetBIOS Domain and System Name Using the Server
Name
.sp
.LP
The following example shows how to use the \fBsmbutil status\fR command to
obtain the NetBIOS domain and system name of the \fBexample\fR server. The
server name, \fBexample\fR, is specified on the command line.
.sp
.in +2
.nf
$ \fBsmbutil status example\fR
Domain: WORKGROUP
Server: EXAMPLE
.fi
.in -2
.sp
.LP
\fBExample 8 \fRObtaining the NetBIOS Domain and System Name Using the IP
Address
.sp
.LP
The following example shows how to use the \fBsmbutil status\fR command to
obtain the NetBIOS domain and system name of the \fBexample\fR server. The IP
address, \fB192.168.168.210\fR, is specified on the command line.
.sp
.in +2
.nf
$ \fBsmbutil status 192.168.168.210\fR
Domain: WORKGROUP
Server: EXAMPLE
.fi
.in -2
.sp
.SH FILES
.ne 2
.na
\fB\fB$HOME/.nsmbrc\fR\fR
.ad
.sp .6
.RS 4n
User-settable mount point configuration file to store the description for each
connection.
.RE
.SH ATTRIBUTES
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability See below.
.TE
.sp
.LP
The output is Uncommitted. The rest of the interface is Committed.
.SH SEE ALSO
.LP
\fBmount_smbfs\fR(1M), \fBnsmbrc\fR(4), \fBattributes\fR(5), \fBsmbfs\fR(7FS)
.SH AUTHORS
.LP
This manual page contains material originally authored by Boris Popov,
\fBbp@butya.kz\fR, \fBbp@FreeBSD.org\fR.
.SH NOTES
.LP
The Solaris CIFS client always attempts to use \fBgethostbyname()\fR to resolve
host names. If the host name cannot be resolved, the CIFS client uses NetBIOS
name resolution (NBNS). By default, the Solaris CIFS client permits the use of
NBNS to enable Solaris CIFS clients in Windows environments to work without
additional configuration.
.sp
.LP
Since NBNS has been exploited in the past, you might want to disable it. To
disable NBNS, set the \fBnbns-enabled\fR service management facility property
to \fBfalse\fR. By default, \fBnbns-enabled\fR is set to \fBtrue\fR.
|