1 '\" te
   2 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Right Reserved.
   3 .\" Portions Copyright 1994-2008 The FreeBSD Project. All rights reserved.
   4 .\" 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
   5 .\" 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
   6 .\" 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
   7 .\" 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
   8 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   9 .TH SMBUTIL 1 "Jun 24, 2009"
  10 .SH NAME
  11 smbutil \- Solaris CIFS client utility
  12 .SH SYNOPSIS
  13 .LP
  14 .nf
  15 \fB/usr/bin/smbutil crypt\fR
  16 .fi
  17 
  18 .LP
  19 .nf
  20 \fB/usr/bin/smbutil login [-c] [[\fIdomain\fR/]\fIuser\fR]\fR
  21 .fi
  22 
  23 .LP
  24 .nf
  25 \fB/usr/bin/smbutil login [-c] [\fIuser\fR[@\fIdomain\fR]]\fR
  26 .fi
  27 
  28 .LP
  29 .nf
  30 \fB/usr/bin/smbutil logout [[\fIdomain\fR/]\fIuser\fR]\fR
  31 .fi
  32 
  33 .LP
  34 .nf
  35 \fB/usr/bin/smbutil logout [\fIuser\fR[@\fIdomain\fR]]\fR
  36 .fi
  37 
  38 .LP
  39 .nf
  40 \fB/usr/bin/smbutil logout -a\fR
  41 .fi
  42 
  43 .LP
  44 .nf
  45 \fB/usr/bin/smbutil logoutall\fR
  46 .fi
  47 
  48 .LP
  49 .nf
  50 \fB/usr/bin/smbutil lookup \fIname\fR\fR
  51 .fi
  52 
  53 .LP
  54 .nf
  55 \fB/usr/bin/smbutil status \fIserver\fR\fR
  56 .fi
  57 
  58 .LP
  59 .nf
  60 \fB/usr/bin/smbutil view [-A | -U \fIuser\fR] //[\fIdomain\fR;][\fIuser\fR[:\fIpassword\fR]@]\fIserver\fR\fR
  61 .fi
  62 
  63 .LP
  64 .nf
  65 \fB/usr/bin/smbutil [\fB-?dv\fR]\fR
  66 .fi
  67 
  68 .SH DESCRIPTION
  69 .sp
  70 .LP
  71 The \fBsmbutil\fR command controls the Solaris CIFS client and issues various
  72 commands.
  73 .SS "Subcommands"
  74 .sp
  75 .LP
  76 The \fBsmbutil\fR command supports the following subcommands:
  77 .sp
  78 .ne 2
  79 .na
  80 \fB\fBcrypt\fR\fR
  81 .ad
  82 .sp .6
  83 .RS 4n
  84 Creates a hash of a password. This subcommand prompts for a password and writes
  85 the hash to standard output. This hash value is suitable for use as a value for
  86 the \fBpassword\fR property in the \fB$HOME/.nsmbrc\fR file.
  87 .sp
  88 The hashed password begins with two dollar signs (\fB$$\fR). If you assign this
  89 hashed password to the \fBpassword\fR property in your \fB$HOME/.nsmbrc\fR, be
  90 sure that you escape the special characters in the password.
  91 .sp
  92 If you plan to store hashed passwords in your \fB$HOME/.nsmbrc\fR file, ensure
  93 that the file permissions are set so that only the owner can read or write the
  94 file (\fB400\fR or \fB600\fR), or the passwords are ignored.
  95 .RE
  96 
  97 .sp
  98 .ne 2
  99 .na
 100 \fB\fBlogin [-c] [ [[\fIdomain\fR/]\fIuser\fR] | [\fIuser\fR[@\fIdomain\fR]
 101 ]\fR\fR
 102 .ad
 103 .sp .6
 104 .RS 4n
 105 Specifies persistent password information to be used for a CIFS server user
 106 account. When you specify this information, mounts can be done without a
 107 password prompt in non-Kerberos configurations. Kerberos sites should use
 108 Kerberos automatically, not prompt for a password. If a default domain is
 109 available in SMF or \fBnsmbrc\fR(4), the domain can be omitted. If a user name
 110 is not specified, the Solaris user account name is used.
 111 .sp
 112 Use the \fB-c\fR to check whether a persistent password is set for the
 113 specified user.
 114 .sp
 115 Passwords can also be stored for a specific server by using a server name in
 116 place of the domain name. This capability is useful with servers that are
 117 configured for "workgroup mode."
 118 .RE
 119 
 120 .sp
 121 .ne 2
 122 .na
 123 \fB\fBlogout [ [[\fIdomain\fR/]\fIuser\fR] | [\fIuser\fR[@\fIdomain\fR] ]\fR\fR
 124 .ad
 125 .sp .6
 126 .RS 4n
 127 Erases the persistent passwords for the user running the command.
 128 .sp
 129 The user name and domain name portions of the name are optional. If these names
 130 are not specified, the user name and domain name values are taken from the
 131 properties set in your environment. See the \fBnsmbrc\fR(4) manual page.
 132 .sp
 133 If you stored your password for a specific server, specify the server name in
 134 place of the domain name.
 135 .RE
 136 
 137 .sp
 138 .ne 2
 139 .na
 140 \fB\fBlogout -a\fR\fR
 141 .ad
 142 .sp .6
 143 .RS 4n
 144 Erases all of the persistent passwords that are stored for the user who is
 145 running the command.
 146 .RE
 147 
 148 .sp
 149 .ne 2
 150 .na
 151 \fB\fBlogoutall\fR\fR
 152 .ad
 153 .sp .6
 154 .RS 4n
 155 Erases all the persistent passwords that are stored by all users running the
 156 \fBsmbutil login\fR command.
 157 .sp
 158 This command must be run as superuser.
 159 .RE
 160 
 161 .sp
 162 .ne 2
 163 .na
 164 \fB\fBlookup \fIname\fR\fR\fR
 165 .ad
 166 .sp .6
 167 .RS 4n
 168 Resolves the specified \fIname\fR to an IP address.
 169 .sp
 170 This subcommand is only supported if an NBNS/WINS name server is available.
 171 .RE
 172 
 173 .sp
 174 .ne 2
 175 .na
 176 \fB\fBstatus \fIserver\fR\fR\fR
 177 .ad
 178 .sp .6
 179 .RS 4n
 180 Resolves the specified server to the NetBIOS domain and system name.
 181 \fIserver\fR can be an IP address or a DNS name.
 182 .RE
 183 
 184 .sp
 185 .ne 2
 186 .na
 187 \fB\fBview [-A | -U \fIuser\fR]
 188 //[\fIdomain\fR;][\fIuser\fR[:\fIpassword\fR]@]\fIserver\fR\fR\fR
 189 .ad
 190 .sp .6
 191 .RS 4n
 192 Lists the resources available to \fIuser\fR on the specified \fIserver\fR.
 193 .sp
 194 You can specify the \fB-A\fR option to view the resources as an anonymous user
 195 or the \fB-U\fR \fIuser\fR option to view the resources as the specified user.
 196 These options are mutually exclusive.
 197 .sp
 198 If the resource includes a domain, you must escape the semicolon that appears
 199 after the domain name to prevent it from being interpreted by the command
 200 shell. For instance, surround the entire resource name with single quotes:
 201 \fBsmbutil view '//SALES;george@RSERVER'\fR.
 202 .RE
 203 
 204 .SH OPTIONS
 205 .sp
 206 .LP
 207 The following global options are supported:
 208 .sp
 209 .ne 2
 210 .na
 211 \fB\fB-d\fR\fR
 212 .ad
 213 .RS 13n
 214 Produces debugging output.
 215 .RE
 216 
 217 .sp
 218 .ne 2
 219 .na
 220 \fB\fB-v\fR\fR
 221 .ad
 222 .RS 13n
 223 Produces verbose output.
 224 .RE
 225 
 226 .sp
 227 .ne 2
 228 .na
 229 \fB\fB-?\fR\fR
 230 .ad
 231 .RS 13n
 232 Prints a short help message.
 233 .RE
 234 
 235 .SH EXAMPLES
 236 .LP
 237 \fBExample 1 \fRCreating a Password Hash for the \fB$HOME/.nsmbrc\fR File
 238 .sp
 239 .LP
 240 The following example shows how to use the \fBsmbutil crypt\fR command to
 241 create a hash of the password you specify. Then, you can use the hash as the
 242 value for the \fB$HOME/.nsmbrc\fR file.
 243 
 244 .sp
 245 .LP
 246 Be sure to escape the two dollar-sign prefix of the hashed password if you
 247 store it as a value of the \fBpassword\fR property.
 248 
 249 .sp
 250 .in +2
 251 .nf
 252 $ \fBsmbutil crypt\fR
 253 Password:
 254 $$178465324253e0c07
 255 .fi
 256 .in -2
 257 .sp
 258 
 259 .sp
 260 .LP
 261 The following \fB$HOME/.nsmbrc\fR file fragment shows how the password hash
 262 value is set:
 263 
 264 .sp
 265 .in +2
 266 .nf
 267 [RSERVER:george]
 268 charsets=koi8-r:cp866
 269 password='$$178465324253e0c07'
 270 .fi
 271 .in -2
 272 .sp
 273 
 274 .LP
 275 \fBExample 2 \fRStoring a Password for a CIFS Server
 276 .sp
 277 .LP
 278 The following example shows how to use the \fBsmbutil login\fR command to store
 279 the \fBroot@example\fR user's password.
 280 
 281 .sp
 282 .in +2
 283 .nf
 284 $ \fBsmbutil login root@example\fR
 285 Password:
 286 .fi
 287 .in -2
 288 .sp
 289 
 290 .LP
 291 \fBExample 3 \fRErasing the Stored Password
 292 .sp
 293 .LP
 294 The following example shows how to use the \fBsmbutil logout\fR command to
 295 remove the \fBroot@example\fR user's password.
 296 
 297 .sp
 298 .in +2
 299 .nf
 300 $ \fBsmbutil logout root@example\fR
 301 .fi
 302 .in -2
 303 .sp
 304 
 305 .LP
 306 \fBExample 4 \fRViewing Available Shares
 307 .sp
 308 .LP
 309 The following example shows how to use the \fBsmbutil view\fR command to see
 310 the available shares for user \fBroot\fR on server \fBexample\fR.
 311 
 312 .sp
 313 .in +2
 314 .nf
 315 $ \fBsmbutil view //root@example\fR
 316 Password:
 317 Share        Type       Comment
 318 -------------------------------
 319 netlogon     disk       Network Logon Service
 320 ipc$         IPC        IPC Service (Samba Server)
 321 tmp          disk       Temporary file space
 322 public       disk       Public Stuff
 323 root         disk       Home Directories
 324 
 325 5 shares listed from 5 available
 326 .fi
 327 .in -2
 328 .sp
 329 
 330 .LP
 331 \fBExample 5 \fRViewing Available Shares as an Anonymous User
 332 .sp
 333 .LP
 334 The following example shows how to use the \fBsmbutil view\fR command to
 335 anonymously view the available shares on the \fBexample\fR server.
 336 
 337 .sp
 338 .in +2
 339 .nf
 340 $ \fBsmbutil view -A //example\fR
 341 Share        Type       Comment
 342 -------------------------------
 343 netlogon     disk       Network Logon Service
 344 ipc$         IPC        IPC Service (Samba Server)
 345 tmp          disk       Temporary file space
 346 public       disk       Public Stuff
 347 ethereal     disk       /export/ethereal
 348 myshare      disk       Jan's stuff
 349 
 350 6 shares listed from 6 available
 351 .fi
 352 .in -2
 353 .sp
 354 
 355 .LP
 356 \fBExample 6 \fRObtaining the IP Address From a Server Name
 357 .sp
 358 .LP
 359 The following example shows how to use the \fBsmbutil lookup\fR command to
 360 obtain the IP address of the \fBexample\fR server.
 361 
 362 .sp
 363 .in +2
 364 .nf
 365 $ \fBsmbutil lookup example\fR
 366 Got response from 192.168.168.210
 367 IP address of example: 192.168.168.210
 368 .fi
 369 .in -2
 370 .sp
 371 
 372 .LP
 373 \fBExample 7 \fRObtaining the NetBIOS Domain and System Name Using the Server
 374 Name
 375 .sp
 376 .LP
 377 The following example shows how to use the \fBsmbutil status\fR command to
 378 obtain the NetBIOS domain and system name of the \fBexample\fR server. The
 379 server name, \fBexample\fR, is specified on the command line.
 380 
 381 .sp
 382 .in +2
 383 .nf
 384 $ \fBsmbutil status example\fR
 385 Domain: WORKGROUP
 386 Server: EXAMPLE
 387 .fi
 388 .in -2
 389 .sp
 390 
 391 .LP
 392 \fBExample 8 \fRObtaining the NetBIOS Domain and System Name Using the IP
 393 Address
 394 .sp
 395 .LP
 396 The following example shows how to use the \fBsmbutil status\fR command to
 397 obtain the NetBIOS domain and system name of the \fBexample\fR server. The IP
 398 address, \fB192.168.168.210\fR, is specified on the command line.
 399 
 400 .sp
 401 .in +2
 402 .nf
 403 $ \fBsmbutil status 192.168.168.210\fR
 404 Domain: WORKGROUP
 405 Server: EXAMPLE
 406 .fi
 407 .in -2
 408 .sp
 409 
 410 .SH FILES
 411 .sp
 412 .ne 2
 413 .na
 414 \fB\fB$HOME/.nsmbrc\fR\fR
 415 .ad
 416 .sp .6
 417 .RS 4n
 418 User-settable mount point configuration file to store the description for each
 419 connection.
 420 .RE
 421 
 422 .SH ATTRIBUTES
 423 .sp
 424 .LP
 425 See \fBattributes\fR(5) for descriptions of the following attributes:
 426 .sp
 427 
 428 .sp
 429 .TS
 430 box;
 431 c | c
 432 l | l .
 433 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 434 _
 435 Interface Stability     See below.
 436 .TE
 437 
 438 .sp
 439 .LP
 440 The output is Uncommitted. The rest of the interface is Committed.
 441 .SH SEE ALSO
 442 .sp
 443 .LP
 444 \fBmount_smbfs\fR(1M), \fBnsmbrc\fR(4), \fBattributes\fR(5), \fBsmbfs\fR(7FS)
 445 .SH AUTHORS
 446 .sp
 447 .LP
 448 This manual page contains material originally authored by Boris Popov,
 449 \fBbp@butya.kz\fR, \fBbp@FreeBSD.org\fR.
 450 .SH NOTES
 451 .sp
 452 .LP
 453 The Solaris CIFS client always attempts to use \fBgethostbyname()\fR to resolve
 454 host names. If the host name cannot be resolved, the CIFS client uses NetBIOS
 455 name resolution (NBNS). By default, the Solaris CIFS client permits the use of
 456 NBNS to enable Solaris CIFS clients in Windows environments to work without
 457 additional configuration.
 458 .sp
 459 .LP
 460 Since NBNS has been exploited in the past, you might want to disable it. To
 461 disable NBNS, set the \fBnbns-enabled\fR service management facility property
 462 to \fBfalse\fR. By default, \fBnbns-enabled\fR is set to \fBtrue\fR.