User Commands smbutil(1)
NAME
smbutil - Solaris SMB 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 SMB client and
issues various commands. SubcommandsThe 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 thepassword property in the $HOME/.nsmbrc file.
The hashed password begins with two dollar signs ($$).
SunOS 5.11 Last change: 19 Mar 2010 1
User Commands smbutil(1)
If you assign this hashed password to the password pro-
perty 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 foran SMB server user account. When you specify this infor-
mation, mounts can be done without a password prompt innon-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 username and domain name values are taken from the proper-
ties 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.SunOS 5.11 Last change: 19 Mar 2010 2
User Commands smbutil(1)
logoutall Erases all the persistent passwords that are stored byall 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 mutu-
ally 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 singlequotes: 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.
SunOS 5.11 Last change: 19 Mar 2010 3
User Commands smbutil(1)
EXAMPLES
Example 1 Creating a Password Hash for the $HOME/.nsmbrc
FileThe 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 pro-
perty.$ 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 an SMB ServerThe 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 PasswordThe following example shows how to use the smbutil logout
command to remove the root@example user's password.SunOS 5.11 Last change: 19 Mar 2010 4
User Commands smbutil(1)
$ smbutil logout root@example
Example 4 Viewing Available SharesThe following example shows how to use the smbutil view com-
mand to see the available shares for user root on server example.$ smbutil view //root@example
Password: Share Type Comment-------------------------------
netlogon disk Network Logon Serviceipc$ 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 UserThe following example shows how to use the smbutil view com-
mand to anonymously view the available shares on the example server.$ smbutil view -A //example
Share Type Comment-------------------------------
netlogon disk Network Logon Serviceipc$ 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 NameSunOS 5.11 Last change: 19 Mar 2010 5
User Commands smbutil(1)
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 NameThe 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: WORKGROUPServer: EXAMPLE
Example 8 Obtaining the NetBIOS Domain and System Name Using the IP AddressThe following example shows how to use the smbutil status
command to obtain the NetBIOS domain and system name of theexample server. The IP address, 192.168.168.210, is speci-
fied on the command line.$ smbutil status 192.168.168.210
Domain: WORKGROUPServer: 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 attri-
butes:SunOS 5.11 Last change: 19 Mar 2010 6
User Commands smbutil(1)
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | SUNWsmbfscu ||_____________________________|_____________________________|
| Interface Stability | See below. ||_____________________________|_____________________________|
The output is Uncommitted. The rest of the interface is Com-
mitted.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. NOTESThe Solaris SMB client always attempts to use gethost-
byname() to resolve host names. If the host name cannot be resolved, the SMB client uses NetBIOS name resolution (NBNS). By default, the Solaris SMB client permits the useof NBNS to enable Solaris SMB clients in Windows environ-
ments to work without additional configuration. Since NBNS has been exploited in the past, you might want todisable 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 Last change: 19 Mar 2010 7