net — Tool for administration of Samba and remote CIFS servers.
net {<ads|rap|rpc>} [-h] [-w workgroup] [-W myworkgroup] [-U user] [-I ip-address] [-p port] [-n myname] [-s conffile] [-S server] [-l] [-P] [-D debuglevel]
This tool is part of the Samba(7) suite.
The samba net utility is meant to work just like the net utility available for windows and DOS. The first argument should be used to specify the protocol to use when executing a certain command. ADS is used for ActiveDirectory, RAP is using for old (Win9x/NT3) clients and RPC can be used for NT4 and Windows 2000. If this argument is omitted, net will try to determine it automatically. Not all commands are available on all protocols.
Print a summary of command line options.
Sets target workgroup or domain. You have to specify either this option or the IP address or the name of a server.
Sets client workgroup or domain
User name to use
IP address of target server to use. You have to specify either this option or a target workgroup or a target server.
Port on the target server to connect to (usually 139 or 445). Defaults to trying 445 first, then 139.
This option allows you to override the NetBIOS name that Samba uses for itself. This is identical to setting the netbios name parameter in the smb.conf file. However, a command line setting will take precedence over settings in smb.conf.
The file specified contains the configuration details required by the server. The information in this file includes server-specific information such as what printcap file to use, as well as descriptions of all the services that the server is to provide. See smb.conf for more information. The default configuration file name is determined at compile time.
Name of target server. You should specify either this option or a target workgroup or a target IP address.
When listing data, give more information on each item.
Make queries to the external server using the machine account of the local server.
debuglevel is an integer from 0 to 10. The default value if this parameter is not specified is zero.
The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day to day running - it generates a small amount of information about operations carried out.
Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.
Note that specifying this parameter here will override the log level parameter in the smb.conf file.
This command allows the Samba machine account password to be set from an external application to a machine account password that has already been stored in Active Directory. DO NOT USE this command unless you know exactly what you are doing. The use of this command requires that the force flag (-f) be used also. There will be NO command prompt. Whatever information is piped into stdin, either by typing at the command line or otherwise, will be stored as the literal machine password. Do NOT use this without care and attention as it will overwrite a legitimate machine password without warning. YOU HAVE BEEN WARNED.
The NET TIME command allows you to view the time on a remote server or synchronise the time on the local server with the time on the remote server.
Without any options, the NET TIME command displays the time on the remote server.
Displays the time on the remote server in a format ready for /bin/date
Tries to set the date and time of the local server to that on the remote server using /bin/date.
Displays the timezone in hours from GMT on the remote computer.
Join a domain. If the account already exists on the server, and [TYPE] is MEMBER, the machine will attempt to join automatically. (Assuming that the machine has been created in server manager) Otherwise, a password will be prompted for, and a new account may be created.
[TYPE] may be PDC, BDC or MEMBER to specify the type of server joining the domain.
Join a domain. Use the OLDJOIN option to join the domain using the old style of domain joining - you need to create a trust account in server manager first.
Delete specified user
List all users
List the domain groups of a the specified user.
Add specified user.
List user groups.
Delete specified group.
Create specified group.
Enumerates all exported resources (network shares) on target server.
Adds a share from a server (makes the export active). Maxusers specifies the number of users that can be connected to the share simultaneously.
Delete specified share.
List all open files on remote server.
Close file with specified fileid on remote server.
Print information on specified fileid. Currently listed are: file-id, username, locks, path, permissions.
Currently NOT implemented.
Without any other options, SESSION enumerates all active SMB/CIFS sessions on the target server.
Close the specified sessions.
Give a list with all the open files in specified session.
List all servers in specified domain or workgroup. Defaults to local domain.
Lists all domains and workgroups visible on the current network.
Lists the specified print queue and print jobs on the server. If the QUEUE_NAME is omitted, all queues are listed.
Delete job with specified id.
Validate whether the specified user can log in to the remote server. If the password is not specified on the commandline, it will be prompted.
Currently NOT implemented.
List all members of the specified group.
Delete member from group.
Add member to group.
Execute the specified command on the remote server. Only works with OS/2 servers.
Currently NOT implemented.
Start the specified service on the remote server. Not implemented yet.
Currently NOT implemented.
Stop the specified service on the remote server.
Currently NOT implemented.
Change password of USER from OLDPASS to NEWPASS.
Lookup the IP address of the given host with the specified type (netbios suffix). The type defaults to 0x20 (workstation).
Give IP address of LDAP server of specified DOMAIN. Defaults to local domain.
Give IP address of KDC for the specified REALM. Defaults to local realm.
Give IP's of Domain Controllers for specified DOMAIN. Defaults to local domain.
Give IP of master browser for specified DOMAIN or workgroup. Defaults to local domain.
Samba uses a general caching interface called 'gencache'. It can be controlled using 'NET CACHE'.
All the timeout parameters support the suffixes:
s - Seconds |
m - Minutes |
h - Hours |
d - Days |
w - Weeks |
Add specified key+data to the cache with the given timeout.
Delete key from the cache.
Update data of existing cache entry.
Search for the specified pattern in the cache data.
List all current items in the cache.
Remove all the current items from the cache.
Print the SID of the specified domain, or if the parameter is omitted, the SID of the domain the local server is in.
Sets domain sid for the local server to the specified SID.
Manage the mappings between Windows group SIDs and UNIX groups. Parameters take the for "parameter=value". Common options include:
unixgroup - Name of the UNIX group
ntgroup - Name of the Windows NT group (must be resolvable to a SID
rid - Unsigned 32-bit integer
sid - Full SID in the form of "S-1-..."
type - Type of the group; either 'domain', 'local', or 'builtin'
comment - Freeform text description of the group
Add a new group mapping entry
net groupmap add {rid=int|sid=string} unixgroup=string [type={domain|local|builtin}] [ntgroup=string] [comment=string]
Delete a group mapping entry
net groupmap delete {ntgroup=string|sid=SID}
Update en existing group entry
net groupmap modify {ntgroup=string|sid=SID} [unixgroup=string] [comment=string] [type={domain|local}
List existing group mapping entries
net groupmap list [verbose] [ntgroup=string] [sid=SID]
Prints out the highest RID currently in use on the local server (by the active 'passdb backend').
Print information about the domain of the remote server, such as domain name, domain sid and number of users and groups.
Check whether participation in a domain is still valid.
Force change of domain trust password.
Add a interdomain trust account for DOMAIN to the remote server.
Remove interdomain trust account for DOMAIN from the remote server.
Currently NOT implemented.
Establish a trust relationship to a trusting domain. Interdomain account must already be created on the remote PDC.
Abandon relationship to trusted domain
List all current interdomain trust relationships.
Abort the shutdown of a remote server.
Shut down the remote server.
Reboot after shutdown.
Force shutting down all applications.
Timeout before system will be shut down. An interactive user of the system can use this time to cancel the shutdown.
Display the specified message on the screen to announce the shutdown.
Print out sam database of remote server. You need to run this on either a BDC.
Export users, aliases and groups from remote server to local server. Can only be run an a BDC.
Fetch domain SID and store it in the local secrets.tdb.
Make the remote host leave the domain it is part of.
Print out status of machine account of the local machine in ADS. Prints out quite some debug info. Aimed at developers, regular users should use NET ADS TESTJOIN.
Lookup info for PRINTER on SERVER. The printer name defaults to "*", the server name defaults to the local host.
Publish specified printer using ADS.
Remove specified printer from ADS directory.
Perform a raw LDAP search on a ADS server and dump the results. The expression is a standard LDAP search expression, and the attributes are a list of LDAP fields to show in the results.
Example: net ads search '(objectCategory=group)' sAMAccountName
Perform a raw LDAP search on a ADS server and dump the results. The DN standard LDAP DN, and the attributes are a list of LDAP fields to show in the result.
Example: net ads dn 'CN=administrator,CN=Users,DC=my,DC=domain' SAMAccountName
Print out workgroup name for specified kerberos realm.
Gives usage information for the specified command.
This man page is complete for version 3.0 of the Samba suite.
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed.
The net manpage was written by Jelmer Vernooij.