xref: /illumos-gate/usr/src/man/man1/smbutil.1 (revision 67e157eca677c3d1b1c5d1049d9fc53c2e05033c)
te
Copyright (c) 2009, Sun Microsystems, Inc. All Right 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.
SMBUTIL 1 "Jun 24, 2009"
NAME
smbutil - Solaris CIFS client utility
SYNOPSIS

/usr/bin/smbutil crypt

/usr/bin/smbutil login [-c] [[domain/]user]

/usr/bin/smbutil login [-c] [user[@domain]]

/usr/bin/smbutil logout [[domain/]user]

/usr/bin/smbutil logout [user[@domain]]

/usr/bin/smbutil logout -a

/usr/bin/smbutil logoutall

/usr/bin/smbutil lookup name

/usr/bin/smbutil status server

/usr/bin/smbutil view [-A | -U user] //[domain;][user[:password]@]server

/usr/bin/smbutil [-?dv]
DESCRIPTION

The smbutil command controls the Solaris CIFS client and issues various commands.

"Subcommands"

The smbutil command supports the following subcommands: crypt

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 password property in the $HOME/.nsmbrc file. The hashed password begins with two dollar signs ($$). If you assign this hashed password to the password property in your $HOME/.nsmbrc, be sure that you escape the special characters in the password. If you plan to store hashed passwords in your $HOME/.nsmbrc file, ensure that the file permissions are set so that only the owner can read or write the file (400 or 600), or the passwords are ignored.

login [-c] [ [[domain/]user] | [user[@domain] ]

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 nsmbrc(4), the domain can be omitted. If a user name is not specified, the Solaris user account name is used. Use the -c to check whether a persistent password is set for the specified user. 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."

logout [ [[domain/]user] | [user[@domain] ]

Erases the persistent passwords for the user running the command. 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 nsmbrc(4) manual page. If you stored your password for a specific server, specify the server name in place of the domain name.

logout -a

Erases all of the persistent passwords that are stored for the user who is running the command.

logoutall

Erases all the persistent passwords that are stored by all users running the smbutil login command. This command must be run as superuser.

lookup name

Resolves the specified name to an IP address. This subcommand is only supported if an NBNS/WINS name server is available.

status server

Resolves the specified server to the NetBIOS domain and system name. server can be an IP address or a DNS name.

view [-A | -U user] //[domain;][user[:password]@]server

Lists the resources available to user on the specified server. You can specify the -A option to view the resources as an anonymous user or the -U user option to view the resources as the specified user. These options are mutually exclusive. 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: smbutil view '//SALES;george@RSERVER'.

OPTIONS

The following global options are supported: -d

Produces debugging output.

-v

Produces verbose output.

-?

Prints a short help message.

EXAMPLES

Example 1 Creating a Password Hash for the $HOME/.nsmbrc File

The following example shows how to use the smbutil crypt command to create a hash of the password you specify. Then, you can use the hash as the value for the $HOME/.nsmbrc file.

Be sure to escape the two dollar-sign prefix of the hashed password if you store it as a value of the password property.

$ smbutil crypt
Password:
$$178465324253e0c07

The following $HOME/.nsmbrc file fragment shows how the password hash value is set:

[RSERVER:george]
charsets=koi8-r:cp866
password='$$178465324253e0c07'

Example 2 Storing a Password for a CIFS Server

The following example shows how to use the smbutil login command to store the root@example user's password.

$ smbutil login root@example
Password:

Example 3 Erasing the Stored Password

The following example shows how to use the smbutil logout command to remove the root@example user's password.

$ smbutil logout root@example

Example 4 Viewing Available Shares

The following example shows how to use the smbutil view command to see the available shares for user root on server example.

$ smbutil view //root@example
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

Example 5 Viewing Available Shares as an Anonymous User

The following example shows how to use the smbutil view command to anonymously view the available shares on the example server.

$ smbutil view -A //example
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

Example 6 Obtaining the IP Address From a Server Name

The following example shows how to use the smbutil lookup command to obtain the IP address of the example server.

$ smbutil lookup example
Got response from 192.168.168.210
IP address of example: 192.168.168.210

Example 7 Obtaining the NetBIOS Domain and System Name Using the Server Name

The following example shows how to use the smbutil status command to obtain the NetBIOS domain and system name of the example server. The server name, example, is specified on the command line.

$ smbutil status example
Domain: WORKGROUP
Server: EXAMPLE

Example 8 Obtaining the NetBIOS Domain and System Name Using the IP Address

The following example shows how to use the smbutil status command to obtain the NetBIOS domain and system name of the example server. The IP address, 192.168.168.210, is specified on the command line.

$ smbutil status 192.168.168.210
Domain: WORKGROUP
Server: EXAMPLE
FILES
$HOME/.nsmbrc

User-settable mount point configuration file to store the description for each connection.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface Stability See below.

The output is Uncommitted. The rest of the interface is Committed.

SEE ALSO

mount_smbfs(1M), nsmbrc(4), attributes(5), smbfs(7FS)

AUTHORS

This manual page contains material originally authored by Boris Popov, bp@butya.kz, bp@FreeBSD.org.

NOTES

The Solaris CIFS client always attempts to use gethostbyname() 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.

Since NBNS has been exploited in the past, you might want to disable it. To disable NBNS, set the nbns-enabled service management facility property to false. By default, nbns-enabled is set to true.