1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % globalentities SYSTEM '../entities/global.entities'> %globalentities;
9 <refentrytitle>net</refentrytitle>
10 <manvolnum>8</manvolnum>
15 <refname>net</refname>
16 <refpurpose>Tool for administration of Samba and remote
23 <command>net</command>
24 <arg choice="req"><ads|rap|rpc></arg>
25 <arg choice="opt">-h</arg>
26 <arg choice="opt">-w workgroup</arg>
27 <arg choice="opt">-W myworkgroup</arg>
28 <arg choice="opt">-U user</arg>
29 <arg choice="opt">-I ip-address</arg>
30 <arg choice="opt">-p port</arg>
31 <arg choice="opt">-n myname</arg>
32 <arg choice="opt">-s conffile</arg>
33 <arg choice="opt">-S server</arg>
34 <arg choice="opt">-l</arg>
35 <arg choice="opt">-P</arg>
36 <arg choice="opt">-D debuglevel</arg>
41 <title>DESCRIPTION</title>
43 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
44 <manvolnum>7</manvolnum></citerefentry> suite.</para>
46 <para>The samba net utility is meant to work just like the net utility
47 available for windows and DOS. The first argument should be used
48 to specify the protocol to use when executing a certain command.
49 ADS is used for ActiveDirectory, RAP is using for old (Win9x/NT3)
50 clients and RPC can be used for NT4 and Windows 2000. If this
51 argument is omitted, net will try to determine it automatically.
52 Not all commands are available on all protocols.
58 <title>OPTIONS</title>
64 <term>-w target-workgroup</term>
66 Sets target workgroup or domain. You have to specify
67 either this option or the IP address or the name of a server.
72 <term>-W workgroup</term>
74 Sets client workgroup or domain
86 <term>-I ip-address</term>
88 IP address of target server to use. You have to
89 specify either this option or a target workgroup or
97 Port on the target server to connect to (usually 139 or 445).
98 Defaults to trying 445 first, then 139.
102 &stdarg.netbios.name;
106 <term>-S server</term>
108 Name of target server. You should specify either
109 this option or a target workgroup or a target IP address.
116 When listing data, give more information on each item.
123 Make queries to the external server using the machine account of the local server.
132 <title>COMMANDS</title>
135 <title>CHANGESECRETPW</title>
137 <para>This command allows the Samba machine account password to be set from an external application
138 to a machine account password that has already been stored in Active Directory. DO NOT USE this command
139 unless you know exactly what you are doing. The use of this command requires that the force flag (-f)
140 be used also. There will be NO command prompt. Whatever information is piped into stdin, either by
141 typing at the command line or otherwise, will be stored as the literal machine password. Do NOT use
142 this without care and attention as it will overwrite a legitimate machine password without warning.
143 YOU HAVE BEEN WARNED.
151 <para>The <command>NET TIME</command> command allows you to view the time on a remote server
152 or synchronise the time on the local server with the time on the remote server.</para>
157 <para>Without any options, the <command>NET TIME</command> command
158 displays the time on the remote server.
164 <title>TIME SYSTEM</title>
166 <para>Displays the time on the remote server in a format ready for <command>/bin/date</command></para>
171 <title>TIME SET</title>
172 <para>Tries to set the date and time of the local server to that on
173 the remote server using <command>/bin/date</command>. </para>
178 <title>TIME ZONE</title>
180 <para>Displays the timezone in hours from GMT on the remote computer.</para>
186 <title>[RPC|ADS] JOIN [TYPE] [-U username[%password]] [options]</title>
189 Join a domain. If the account already exists on the server, and
190 [TYPE] is MEMBER, the machine will attempt to join automatically.
191 (Assuming that the machine has been created in server manager)
192 Otherwise, a password will be prompted for, and a new account may
196 [TYPE] may be PDC, BDC or MEMBER to specify the type of server
202 <title>[RPC] OLDJOIN [options]</title>
204 <para>Join a domain. Use the OLDJOIN option to join the domain
205 using the old style of domain joining - you need to create a trust
206 account in server manager first.</para>
210 <title>[RPC|ADS] USER</title>
213 <title>[RPC|ADS] USER DELETE <replaceable>target</replaceable></title>
215 <para>Delete specified user</para>
220 <title>[RPC|ADS] USER LIST</title>
222 <para>List all users</para>
227 <title>[RPC|ADS] USER INFO <replaceable>target</replaceable></title>
229 <para>List the domain groups of a the specified user.</para>
234 <title>[RPC|ADS] USER ADD <replaceable>name</replaceable> [password] [-F user flags] [-C comment]</title>
236 <para>Add specified user.</para>
241 <title>[RPC|ADS] GROUP</title>
244 <title>[RPC|ADS] GROUP [misc options] [targets]</title>
245 <para>List user groups.</para>
249 <title>[RPC|ADS] GROUP DELETE <replaceable>name</replaceable> [misc. options]</title>
251 <para>Delete specified group.</para>
256 <title>[RPC|ADS] GROUP ADD <replaceable>name</replaceable> [-C comment]</title>
258 <para>Create specified group.</para>
264 <title>[RAP|RPC] SHARE</title>
267 <title>[RAP|RPC] SHARE [misc. options] [targets]</title>
269 <para>Enumerates all exported resources (network shares) on target server.</para>
274 <title>[RAP|RPC] SHARE ADD <replaceable>name=serverpath</replaceable> [-C comment] [-M maxusers] [targets]</title>
276 <para>Adds a share from a server (makes the export active). Maxusers
277 specifies the number of users that can be connected to the
278 share simultaneously.</para>
283 <title>SHARE DELETE <replaceable>sharenam</replaceable></title>
285 <para>Delete specified share.</para>
290 <title>[RPC|RAP] FILE</title>
293 <title>[RPC|RAP] FILE</title>
295 <para>List all open files on remote server.</para>
300 <title>[RPC|RAP] FILE CLOSE <replaceable>fileid</replaceable></title>
302 <para>Close file with specified <replaceable>fileid</replaceable> on
303 remote server.</para>
308 <title>[RPC|RAP] FILE INFO <replaceable>fileid</replaceable></title>
311 Print information on specified <replaceable>fileid</replaceable>.
312 Currently listed are: file-id, username, locks, path, permissions.
318 <title>[RAP|RPC] FILE USER</title>
327 <title>SESSION</title>
330 <title>RAP SESSION</title>
332 <para>Without any other options, SESSION enumerates all active SMB/CIFS
333 sessions on the target server.</para>
338 <title>RAP SESSION DELETE|CLOSE <replaceable>CLIENT_NAME</replaceable></title>
340 <para>Close the specified sessions.</para>
345 <title>RAP SESSION INFO <replaceable>CLIENT_NAME</replaceable></title>
347 <para>Give a list with all the open files in specified session.</para>
354 <title>RAP SERVER <replaceable>DOMAIN</replaceable></title>
356 <para>List all servers in specified domain or workgroup. Defaults
357 to local domain.</para>
362 <title>RAP DOMAIN</title>
364 <para>Lists all domains and workgroups visible on the
365 current network.</para>
370 <title>RAP PRINTQ</title>
373 <title>RAP PRINTQ LIST <replaceable>QUEUE_NAME</replaceable></title>
375 <para>Lists the specified print queue and print jobs on the server.
376 If the <replaceable>QUEUE_NAME</replaceable> is omitted, all
377 queues are listed.</para>
382 <title>RAP PRINTQ DELETE <replaceable>JOBID</replaceable></title>
384 <para>Delete job with specified id.</para>
391 <title>RAP VALIDATE <replaceable>user</replaceable> [<replaceable>password</replaceable>]</title>
394 Validate whether the specified user can log in to the
395 remote server. If the password is not specified on the commandline, it
404 <title>RAP GROUPMEMBER</title>
407 <title>RAP GROUPMEMBER LIST <replaceable>GROUP</replaceable></title>
409 <para>List all members of the specified group.</para>
414 <title>RAP GROUPMEMBER DELETE <replaceable>GROUP</replaceable> <replaceable>USER</replaceable></title>
416 <para>Delete member from group.</para>
421 <title>RAP GROUPMEMBER ADD <replaceable>GROUP</replaceable> <replaceable>USER</replaceable></title>
423 <para>Add member to group.</para>
430 <title>RAP ADMIN <replaceable>command</replaceable></title>
432 <para>Execute the specified <replaceable>command</replaceable> on
433 the remote server. Only works with OS/2 servers.
441 <title>RAP SERVICE</title>
444 <title>RAP SERVICE START <replaceable>NAME</replaceable> [arguments...]</title>
446 <para>Start the specified service on the remote server. Not implemented yet.</para>
453 <title>RAP SERVICE STOP</title>
455 <para>Stop the specified service on the remote server.</para>
464 <title>RAP PASSWORD <replaceable>USER</replaceable> <replaceable>OLDPASS</replaceable> <replaceable>NEWPASS</replaceable></title>
467 Change password of <replaceable>USER</replaceable> from <replaceable>OLDPASS</replaceable> to <replaceable>NEWPASS</replaceable>.
473 <title>LOOKUP</title>
476 <title>LOOKUP HOST <replaceable>HOSTNAME</replaceable> [<replaceable>TYPE</replaceable>]</title>
479 Lookup the IP address of the given host with the specified type (netbios suffix).
480 The type defaults to 0x20 (workstation).
486 <title>LOOKUP LDAP [<replaceable>DOMAIN</replaceable></title>
488 <para>Give IP address of LDAP server of specified <replaceable>DOMAIN</replaceable>. Defaults to local domain.</para>
493 <title>LOOKUP KDC [<replaceable>REALM</replaceable>]</title>
495 <para>Give IP address of KDC for the specified <replaceable>REALM</replaceable>.
496 Defaults to local realm.</para>
501 <title>LOOKUP DC [<replaceable>DOMAIN</replaceable>]</title>
503 <para>Give IP's of Domain Controllers for specified <replaceable>
504 DOMAIN</replaceable>. Defaults to local domain.</para>
509 <title>LOOKUP MASTER <replaceable>DOMAIN</replaceable></title>
511 <para>Give IP of master browser for specified <replaceable>DOMAIN</replaceable>
512 or workgroup. Defaults to local domain.</para>
521 <para>Samba uses a general caching interface called 'gencache'. It
522 can be controlled using 'NET CACHE'.</para>
524 <para>All the timeout parameters support the suffixes:
527 <member>s - Seconds</member>
528 <member>m - Minutes</member>
529 <member>h - Hours</member>
530 <member>d - Days</member>
531 <member>w - Weeks</member>
537 <title>CACHE ADD <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable></title>
539 <para>Add specified key+data to the cache with the given timeout.</para>
544 <title>CACHE DEL <replaceable>key</replaceable></title>
546 <para>Delete key from the cache.</para>
551 <title>CACHE SET <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable></title>
553 <para>Update data of existing cache entry.</para>
558 <title>CACHE SEARCH <replaceable>PATTERN</replaceable></title>
560 <para>Search for the specified pattern in the cache data.</para>
565 <title>CACHE LIST</title>
568 List all current items in the cache.
574 <title>CACHE FLUSH</title>
576 <para>Remove all the current items from the cache.</para>
583 <title>GETLOCALSID [DOMAIN]</title>
585 <para>Print the SID of the specified domain, or if the parameter is
586 omitted, the SID of the domain the local server is in.</para>
591 <title>SETLOCALSID S-1-5-21-x-y-z</title>
593 <para>Sets domain sid for the local server to the specified SID.</para>
598 <title>GROUPMAP</title>
600 <para>Manage the mappings between Windows group SIDs and UNIX groups.
601 Parameters take the for "parameter=value". Common options include:</para>
604 <listitem><para>unixgroup - Name of the UNIX group</para></listitem>
605 <listitem><para>ntgroup - Name of the Windows NT group (must be
606 resolvable to a SID</para></listitem>
607 <listitem><para>rid - Unsigned 32-bit integer</para></listitem>
608 <listitem><para>sid - Full SID in the form of "S-1-..."</para></listitem>
609 <listitem><para>type - Type of the group; either 'domain', 'local',
610 or 'builtin'</para></listitem>
611 <listitem><para>comment - Freeform text description of the group</para></listitem>
615 <title>GROUPMAP ADD</title>
617 <para>Add a new group mapping entry</para>
619 <para>net groupmap add {rid=int|sid=string} unixgroup=string [type={domain|local|builtin}] [ntgroup=string] [comment=string]</para>
624 <title>GROUPMAP DELETE</title>
626 <para>Delete a group mapping entry</para>
628 <para>net groupmap delete {ntgroup=string|sid=SID}</para>
633 <title>GROUPMAP MODIFY</title>
635 <para>Update en existing group entry</para>
637 <para>net groupmap modify {ntgroup=string|sid=SID} [unixgroup=string] [comment=string] [type={domain|local}</para>
641 <title>GROUPMAP LIST</title>
643 <para>List existing group mapping entries</para>
645 <para>net groupmap list [verbose] [ntgroup=string] [sid=SID]</para>
653 <title>MAXRID</title>
655 <para>Prints out the highest RID currently in use on the local
656 server (by the active 'passdb backend').
662 <title>RPC INFO</title>
664 <para>Print information about the domain of the remote server,
665 such as domain name, domain sid and number of users and groups.
671 <title>[RPC|ADS] TESTJOIN</title>
673 <para>Check whether participation in a domain is still valid.</para>
678 <title>[RPC|ADS] CHANGETRUSTPW</title>
680 <para>Force change of domain trust password.</para>
685 <title>RPC TRUSTDOM</title>
688 <title>RPC TRUSTDOM ADD <replaceable>DOMAIN</replaceable></title>
690 <para>Add a interdomain trust account for
691 <replaceable>DOMAIN</replaceable> to the remote server.
697 <title>RPC TRUSTDOM DEL <replaceable>DOMAIM</replaceable></title>
699 <para>Remove interdomain trust account for
700 <replaceable>DOMAIN</replaceable> from the remote server.
708 <title>RPC TRUSTDOM ESTABLISH <replaceable>DOMAIN</replaceable></title>
711 Establish a trust relationship to a trusting domain.
712 Interdomain account must already be created on the remote PDC.
718 <title>RPC TRUSTDOM REVOKE <replaceable>DOMAIN</replaceable></title>
719 <para>Abandon relationship to trusted domain</para>
724 <title>RPC TRUSTDOM LIST</title>
726 <para>List all current interdomain trust relationships.</para>
733 <title>RPC ABORTSHUTDOWN</title>
735 <para>Abort the shutdown of a remote server.</para>
740 <title>SHUTDOWN [-t timeout] [-r] [-f] [-C message]</title>
742 <para>Shut down the remote server.</para>
748 Reboot after shutdown.
755 Force shutting down all applications.
760 <term>-t timeout</term>
762 Timeout before system will be shut down. An interactive
763 user of the system can use this time to cancel the shutdown.
768 <term>-C message</term>
769 <listitem><para>Display the specified message on the screen to
770 announce the shutdown.</para></listitem>
777 <title>SAMDUMP</title>
779 <para>Print out sam database of remote server. You need
780 to run this on either a BDC. <!--
781 Is that correct? - Jelmer --></para>
785 <title>VAMPIRE</title>
787 <para>Export users, aliases and groups from remote server to
788 local server. Can only be run an a BDC.
794 <title>GETSID</title>
796 <para>Fetch domain SID and store it in the local <filename>secrets.tdb</filename>. </para>
801 <title>ADS LEAVE</title>
803 <para>Make the remote host leave the domain it is part of. </para>
808 <title>ADS STATUS</title>
810 <para>Print out status of machine account of the local machine in ADS.
811 Prints out quite some debug info. Aimed at developers, regular
812 users should use <command>NET ADS TESTJOIN</command>.</para>
817 <title>ADS PRINTER</title>
820 <title>ADS PRINTER INFO [<replaceable>PRINTER</replaceable>] [<replaceable>SERVER</replaceable>]</title>
823 Lookup info for <replaceable>PRINTER</replaceable> on <replaceable>SERVER</replaceable>. The printer name defaults to "*", the
824 server name defaults to the local host.</para>
829 <title>ADS PRINTER PUBLISH <replaceable>PRINTER</replaceable></title>
831 <para>Publish specified printer using ADS.</para>
836 <title>ADS PRINTER REMOVE <replaceable>PRINTER</replaceable></title>
838 <para>Remove specified printer from ADS directory.</para>
845 <title>ADS SEARCH <replaceable>EXPRESSION</replaceable> <replaceable>ATTRIBUTES...</replaceable></title>
847 <para>Perform a raw LDAP search on a ADS server and dump the results. The
848 expression is a standard LDAP search expression, and the
849 attributes are a list of LDAP fields to show in the results.</para>
851 <para>Example: <userinput>net ads search '(objectCategory=group)' sAMAccountName</userinput>
857 <title>ADS DN <replaceable>DN</replaceable> <replaceable>(attributes)</replaceable></title>
860 Perform a raw LDAP search on a ADS server and dump the results. The
861 DN standard LDAP DN, and the attributes are a list of LDAP fields
862 to show in the result.
865 <para>Example: <userinput>net ads dn 'CN=administrator,CN=Users,DC=my,DC=domain' SAMAccountName</userinput></para>
870 <title>WORKGROUP</title>
872 <para>Print out workgroup name for specified kerberos realm.</para>
878 <title>HELP [COMMAND]</title>
880 <para>Gives usage information for the specified command.</para>
887 <title>VERSION</title>
889 <para>This man page is complete for version 3.0 of the Samba
894 <title>AUTHOR</title>
896 <para>The original Samba software and related utilities
897 were created by Andrew Tridgell. Samba is now developed
898 by the Samba Team as an Open Source project similar
899 to the way the Linux kernel is developed.</para>
901 <para>The net manpage was written by Jelmer Vernooij.</para>