smbutil - Solaris CIFS client utility
/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 lookup name
/usr/bin/smbutil status server
/usr/bin/smbutil view [-A | -U user] //[domain;][user[:password]@]server
The smbutil command controls the Solaris CIFS client and issues various commands.
The smbutil command supports the following subcommands:
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 that are stored for the Solaris user account name of the person running the command.
If any part of user name, domain or user, is not specified, the password is deleted for the user who specified by the user and domain properties described in the nsmbrc(4) manual page.
If you stored your password for a specific server, specify the server name in place of the domain name.
Erases all of the persistent passwords that are stored for the user who is running the command.
Erases all the persistent passwords that are stored by all users running the smbutil login command.
This command must be run as superuser.
Resolves the specified name to an IP address.
This subcommand is only supported if an NBNS/WINS name server is available.
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;[email protected].
The following global options are supported:
-dProduces debugging output.
-vProduces verbose output.
-?Prints a short help message.
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 [email protected] users password.
$ smbutil login [email protected] Password:
Example 3 Erasing the Stored Password
The following example shows how to use the smbutil logout command to remove the [email protected] users password.
$ smbutil logout [email protected]
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 //[email protected] 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 Jans 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
User-settable mount point configuration file to store the description for each connection.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE Availability SUNWsmbfscu
The output is Uncommitted. The rest of the interface is Committed.
mount_smbfs(1M), nsmbrc(4), attributes(5)
This manual page contains material originally authored by Boris Popov, [email protected], [email protected].
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.
|SunOS 5.11||smbutil (1)||26 Feb 2008|