SMBUTIL(1) | User Commands | SMBUTIL(1) |
smbutil - Solaris CIFS client utility
/usr/bin/smbutil crypt
/usr/bin/smbutil discon //[domain;][user@]server
/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]
The smbutil command controls the Solaris CIFS client and issues various commands.
The smbutil command supports the following subcommands:
crypt
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.
discon -U user] //[domain;][userserver
login [-c] [ [[domain/]user] | [user[@domain] ]
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] ]
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(5) manual page.
If you stored your password for a specific server, specify the server name in place of the domain name.
logout -a
logoutall
This command must be run as superuser.
lookup name
This subcommand is only supported if an NBNS/WINS name server is available.
status server
view [-A | -U user] //[domain;][user[:password]@]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'.
The following global options are supported:
-d
-v
-?
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
$HOME/.nsmbrc
See attributes(7) 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.
This manual page contains material originally authored by Boris Popov, bp@butya.kz, bp@FreeBSD.org.
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.
April 11, 2018 | OmniOS |