1 SMBUTIL(1)                       User Commands                      SMBUTIL(1)
   2 
   3 
   4 
   5 NAME
   6        smbutil - Solaris CIFS client utility
   7 
   8 SYNOPSIS
   9        /usr/bin/smbutil crypt
  10 
  11 
  12        /usr/bin/smbutil discon //[domain;][user@]server
  13 
  14 
  15        /usr/bin/smbutil login [-c] [[domain/]user]
  16 
  17 
  18        /usr/bin/smbutil login [-c] [user[@domain]]
  19 
  20 
  21        /usr/bin/smbutil logout [[domain/]user]
  22 
  23 
  24        /usr/bin/smbutil logout [user[@domain]]
  25 
  26 
  27        /usr/bin/smbutil logout -a
  28 
  29 
  30        /usr/bin/smbutil logoutall
  31 
  32 
  33        /usr/bin/smbutil lookup name
  34 
  35 
  36        /usr/bin/smbutil status server
  37 
  38 
  39        /usr/bin/smbutil view [-A | -U user] //[domain;][user[:password]@]server
  40 
  41 
  42        /usr/bin/smbutil [-?dv]
  43 
  44 
  45 DESCRIPTION
  46        The smbutil command controls the Solaris CIFS client and issues various
  47        commands.
  48 
  49    Subcommands
  50        The smbutil command supports the following subcommands:
  51 
  52        crypt
  53 
  54            Creates a hash of a password. This subcommand prompts for a
  55            password and writes the hash to standard output. This hash value is
  56            suitable for use as a value for the password property in the
  57            $HOME/.nsmbrc file.
  58 
  59            The hashed password begins with two dollar signs ($$). If you
  60            assign this hashed password to the password property in your
  61            $HOME/.nsmbrc, be sure that you escape the special characters in
  62            the password.
  63 
  64            If you plan to store hashed passwords in your $HOME/.nsmbrc file,
  65            ensure that the file permissions are set so that only the owner can
  66            read or write the file (400 or 600), or the passwords are ignored.
  67 
  68 
  69        discon -U user] //[domain;][userserver
  70 
  71            Disconnects the specified SMB session to server.  Usage is similar
  72            to the view sub-command.  This sub-command is primarily for use in
  73            tests.
  74 
  75 
  76        login [-c] [ [[domain/]user] | [user[@domain] ]
  77 
  78            Specifies persistent password information to be used for a CIFS
  79            server user account. When you specify this information, mounts can
  80            be done without a password prompt in non-Kerberos configurations.
  81            Kerberos sites should use Kerberos automatically, not prompt for a
  82            password. If a default domain is available in SMF or nsmbrc(4), the
  83            domain can be omitted. If a user name is not specified, the Solaris
  84            user account name is used.
  85 
  86            Use the -c to check whether a persistent password is set for the
  87            specified user.
  88 
  89            Passwords can also be stored for a specific server by using a
  90            server name in place of the domain name. This capability is useful
  91            with servers that are configured for "workgroup mode."
  92 
  93 
  94        logout [ [[domain/]user] | [user[@domain] ]
  95 
  96            Erases the persistent passwords for the user running the command.
  97 
  98            The user name and domain name portions of the name are optional. If
  99            these names are not specified, the user name and domain name values
 100            are taken from the properties set in your environment. See the
 101            nsmbrc(4) manual page.
 102 
 103            If you stored your password for a specific server, specify the
 104            server name in place of the domain name.
 105 
 106 
 107        logout -a
 108 
 109            Erases all of the persistent passwords that are stored for the user
 110            who is running the command.
 111 
 112 
 113        logoutall
 114 
 115            Erases all the persistent passwords that are stored by all users
 116            running the smbutil login command.
 117 
 118            This command must be run as superuser.
 119 
 120 
 121        lookup name
 122 
 123            Resolves the specified name to an IP address.
 124 
 125            This subcommand is only supported if an NBNS/WINS name server is
 126            available.
 127 
 128 
 129        status server
 130 
 131            Resolves the specified server to the NetBIOS domain and system
 132            name.  server can be an IP address or a DNS name.
 133 
 134 
 135        view [-A | -U user] //[domain;][user[:password]@]server
 136 
 137            Lists the resources available to user on the specified server.
 138 
 139            You can specify the -A option to view the resources as an anonymous
 140            user or the -U user option to view the resources as the specified
 141            user.  These options are mutually exclusive.
 142 
 143            If the resource includes a domain, you must escape the semicolon
 144            that appears after the domain name to prevent it from being
 145            interpreted by the command shell. For instance, surround the entire
 146            resource name with single quotes: smbutil view
 147            '//SALES;george@RSERVER'.
 148 
 149 
 150 OPTIONS
 151        The following global options are supported:
 152 
 153        -d
 154                     Produces debugging output.
 155 
 156 
 157        -v
 158                     Produces verbose output.
 159 
 160 
 161        -?
 162                     Prints a short help message.
 163 
 164 
 165 EXAMPLES
 166        Example 1 Creating a Password Hash for the $HOME/.nsmbrc File
 167 
 168 
 169        The following example shows how to use the smbutil crypt command to
 170        create a hash of the password you specify. Then, you can use the hash
 171        as the value for the $HOME/.nsmbrc file.
 172 
 173 
 174 
 175        Be sure to escape the two dollar-sign prefix of the hashed password if
 176        you store it as a value of the password property.
 177 
 178 
 179          $ smbutil crypt
 180          Password:
 181          $$178465324253e0c07
 182 
 183 
 184 
 185 
 186        The following $HOME/.nsmbrc file fragment shows how the password hash
 187        value is set:
 188 
 189 
 190          [RSERVER:george]
 191          charsets=koi8-r:cp866
 192          password='$$178465324253e0c07'
 193 
 194 
 195 
 196        Example 2 Storing a Password for a CIFS Server
 197 
 198 
 199        The following example shows how to use the smbutil login command to
 200        store the root@example user's password.
 201 
 202 
 203          $ smbutil login root@example
 204          Password:
 205 
 206 
 207 
 208        Example 3 Erasing the Stored Password
 209 
 210 
 211        The following example shows how to use the smbutil logout command to
 212        remove the root@example user's password.
 213 
 214 
 215          $ smbutil logout root@example
 216 
 217 
 218 
 219        Example 4 Viewing Available Shares
 220 
 221 
 222        The following example shows how to use the smbutil view command to see
 223        the available shares for user root on server example.
 224 
 225 
 226          $ smbutil view //root@example
 227          Password:
 228          Share        Type       Comment
 229          -------------------------------
 230          netlogon     disk       Network Logon Service
 231          ipc$         IPC        IPC Service (Samba Server)
 232          tmp          disk       Temporary file space
 233          public       disk       Public Stuff
 234          root         disk       Home Directories
 235 
 236          5 shares listed from 5 available
 237 
 238 
 239 
 240        Example 5 Viewing Available Shares as an Anonymous User
 241 
 242 
 243        The following example shows how to use the smbutil view command to
 244        anonymously view the available shares on the example server.
 245 
 246 
 247          $ smbutil view -A //example
 248          Share        Type       Comment
 249          -------------------------------
 250          netlogon     disk       Network Logon Service
 251          ipc$         IPC        IPC Service (Samba Server)
 252          tmp          disk       Temporary file space
 253          public       disk       Public Stuff
 254          ethereal     disk       /export/ethereal
 255          myshare      disk       Jan's stuff
 256 
 257          6 shares listed from 6 available
 258 
 259 
 260 
 261        Example 6 Obtaining the IP Address From a Server Name
 262 
 263 
 264        The following example shows how to use the smbutil lookup command to
 265        obtain the IP address of the example server.
 266 
 267 
 268          $ smbutil lookup example
 269          Got response from 192.168.168.210
 270          IP address of example: 192.168.168.210
 271 
 272 
 273 
 274        Example 7 Obtaining the NetBIOS Domain and System Name Using the Server
 275        Name
 276 
 277 
 278        The following example shows how to use the smbutil status command to
 279        obtain the NetBIOS domain and system name of the example server. The
 280        server name, example, is specified on the command line.
 281 
 282 
 283          $ smbutil status example
 284          Domain: WORKGROUP
 285          Server: EXAMPLE
 286 
 287 
 288 
 289        Example 8 Obtaining the NetBIOS Domain and System Name Using the IP
 290        Address
 291 
 292 
 293        The following example shows how to use the smbutil status command to
 294        obtain the NetBIOS domain and system name of the example server. The IP
 295        address, 192.168.168.210, is specified on the command line.
 296 
 297 
 298          $ smbutil status 192.168.168.210
 299          Domain: WORKGROUP
 300          Server: EXAMPLE
 301 
 302 
 303 
 304 FILES
 305        $HOME/.nsmbrc
 306 
 307            User-settable mount point configuration file to store the
 308            description for each connection.
 309 
 310 
 311 ATTRIBUTES
 312        See attributes(5) for descriptions of the following attributes:
 313 
 314 
 315 
 316 
 317        +--------------------+-----------------+
 318        |  ATTRIBUTE TYPE    | ATTRIBUTE VALUE |
 319        +--------------------+-----------------+
 320        |Interface Stability | See below.      |
 321        +--------------------+-----------------+
 322 
 323 
 324        The output is Uncommitted. The rest of the interface is Committed.
 325 
 326 SEE ALSO
 327        mount_smbfs(1M), nsmbrc(4), attributes(5), smbfs(7FS)
 328 
 329 AUTHORS
 330        This manual page contains material originally authored by Boris Popov,
 331        bp@butya.kz, bp@FreeBSD.org.
 332 
 333 NOTES
 334        The Solaris CIFS client always attempts to use gethostbyname() to
 335        resolve host names. If the host name cannot be resolved, the CIFS
 336        client uses NetBIOS name resolution (NBNS). By default, the Solaris
 337        CIFS client permits the use of NBNS to enable Solaris CIFS clients in
 338        Windows environments to work without additional configuration.
 339 
 340 
 341        Since NBNS has been exploited in the past, you might want to disable
 342        it. To disable NBNS, set the nbns-enabled service management facility
 343        property to false. By default, nbns-enabled is set to true.
 344 
 345 
 346 
 347                                 April 11, 2018                      SMBUTIL(1)