1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
6 <refentrytitle>net</refentrytitle>
7 <manvolnum>8</manvolnum>
8 <refmiscinfo class="source">Samba</refmiscinfo>
9 <refmiscinfo class="manual">System Administration tools</refmiscinfo>
10 <refmiscinfo class="version">&doc.version;</refmiscinfo>
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|--help</arg>
26 <arg choice="opt">-w|--workgroup workgroup</arg>
27 <arg choice="opt">-W|--myworkgroup myworkgroup</arg>
28 <arg choice="opt">-U|--user user</arg>
29 <arg choice="opt">-I|--ipaddress ip-address</arg>
30 <arg choice="opt">-p|--port port</arg>
31 <arg choice="opt">-n myname</arg>
32 <arg choice="opt">-s conffile</arg>
33 <arg choice="opt">-S|--server server</arg>
34 <arg choice="opt">-l|--long</arg>
35 <arg choice="opt">-v|--verbose</arg>
36 <arg choice="opt">-f|--force</arg>
37 <arg choice="opt">-P|--machine-pass</arg>
38 <arg choice="opt">-d debuglevel</arg>
39 <arg choice="opt">-V</arg>
40 <arg choice="opt">--request-timeout seconds</arg>
41 <arg choice="opt">-t|--timeout seconds</arg>
42 <arg choice="opt">-i|--stdin</arg>
43 <arg choice="opt">--tallocreport</arg>
48 <title>DESCRIPTION</title>
50 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
51 <manvolnum>7</manvolnum></citerefentry> suite.</para>
53 <para>The Samba net utility is meant to work just like the net utility
54 available for windows and DOS. The first argument should be used
55 to specify the protocol to use when executing a certain command.
56 ADS is used for ActiveDirectory, RAP is using for old (Win9x/NT3)
57 clients and RPC can be used for NT4 and Windows 2000. If this
58 argument is omitted, net will try to determine it automatically.
59 Not all commands are available on all protocols.
65 <title>OPTIONS</title>
72 <term>-w|--workgroup target-workgroup</term>
74 Sets target workgroup or domain. You have to specify
75 either this option or the IP address or the name of a server.
80 <term>-W|--myworkgroup workgroup</term>
82 Sets client workgroup or domain
87 <term>-U|--user user</term>
94 <term>-I|--ipaddress ip-address</term>
96 IP address of target server to use. You have to
97 specify either this option or a target workgroup or
103 <term>-p|--port port</term>
105 Port on the target server to connect to (usually 139 or 445).
106 Defaults to trying 445 first, then 139.
110 &stdarg.netbios.name;
113 <term>-S|--server server</term>
115 Name of target server. You should specify either
116 this option or a target workgroup or a target IP address.
121 <term>-l|--long</term>
123 When listing data, give more information on each item.
128 <term>-v|--verbose</term>
130 When listing data, give more verbose information on each item.
135 <term>-f|--force</term>
137 Enforcing a net command.
142 <term>-P|--machine-pass</term>
144 Make queries to the external server using the machine account of the local server.
149 <term>--request-timeout 30</term>
151 Let client requests timeout after 30 seconds the default is 10
157 <term>-t|--timeout 30</term>
159 Set timeout for client operations to 30 seconds.
164 <term>--use-ccache</term>
166 Try to use the credentials cached by winbind.
171 <term>-i|--stdin</term>
173 Take input for net commands from standard input.
178 <term>--tallocreport</term>
180 Generate a talloc report while processing a net
186 <term>-T|--test</term>
187 <listitem><para>Only test command sequence, dry-run.
192 <term>-F|--flags FLAGS</term>
193 <listitem><para>Pass down integer flags to a net subcommand.
198 <term>-C|--comment COMMENT</term>
199 <listitem><para>Pass down a comment string to a net subcommand.
204 <term>-n|--myname MYNAME</term>
205 <listitem><para>Use MYNAME as a requester name for a net subcommand.
210 <term>-c|--container CONTAINER</term>
211 <listitem><para>Use a specific AD container for net ads operations.
216 <term>-M|--maxusers MAXUSERS</term>
217 <listitem><para>Fill in the maxusers field in net rpc share operations.
222 <term>-r|--reboot</term>
223 <listitem><para>Reboot a remote machine after a command has been successfully executed (e.g. in remote join operations).
227 <!-- Options for net rpc vampire -->
230 <term>--force-full-repl</term>
232 When calling "net rpc vampire keytab" this option
233 enforces a full re-creation of the generated keytab file.
238 <term>--single-obj-repl</term>
240 When calling "net rpc vampire keytab" this option
241 allows one to replicate just a single object to the generated keytab file.
246 <term>--clean-old-entries</term>
248 When calling "net rpc vampire keytab" this option
249 allows one to cleanup old entries from the generated keytab file.
253 <!-- Options for net idmap -->
257 <listitem><para>Define dbfile for "net idmap" commands.
263 <listitem><para>Activates locking of the dbfile for "net idmap check" command.
268 <term>-a|--auto</term>
269 <listitem><para>Activates noninteractive mode in "net idmap check".
274 <term>--repair</term>
275 <listitem><para>Activates repair mode in "net idmap check".
279 <!-- Options for net rpc share migrate -->
283 <listitem><para>Includes ACLs to be copied in "net rpc share migrate".
289 <listitem><para>Includes file attributes to be copied in "net rpc share migrate".
294 <term>--timestamps</term>
295 <listitem><para>Includes timestamps to be copied in "net rpc share migrate".
300 <term>-X|--exclude DIRECTORY</term>
301 <listitem><para>Allows one to exclude directories when copying with "net rpc share migrate".
306 <term>--destination SERVERNAME</term>
307 <listitem><para>Defines the target servername of migration process (defaults to localhost).
311 <!-- Options for net groupmap set -->
314 <term>-L|--local</term>
315 <listitem><para>Sets the type of group mapping to local
316 (used in "net groupmap set").
321 <term>-D|--domain</term>
322 <listitem><para>Sets the type of group mapping to domain
323 (used in "net groupmap set").
328 <term>-N|--ntname NTNAME</term>
329 <listitem><para>Sets the ntname of a group mapping
330 (used in "net groupmap set").
335 <term>-R|--rid RID</term>
336 <listitem><para>Sets the rid of a group mapping
337 (used in "net groupmap set").
341 <!-- Options for net registry check -->
344 <term>--reg-version REG_VERSION</term>
345 <listitem><para>Assume database version {n|1,2,3}
346 (used in "net registry check").
351 <term>-o|--output FILENAME</term>
352 <listitem><para>Output database file
353 (used in "net registry check").
359 <listitem><para>Create a new database from scratch
360 (used in "net registry check").
364 <!-- Options for net registry import -->
367 <term>--precheck PRECHECK_DB_FILENAME</term>
368 <listitem><para>Defines filename for database prechecking
369 (used in "net registry import").
374 <term>--no-dns-updates</term>
375 <listitem><para>Do not perform DNS updates as part of
381 &popt.common.samba.client;
387 <title>COMMANDS</title>
390 <title>CHANGESECRETPW</title>
392 <para>This command allows the Samba machine account password to be set from an external application
393 to a machine account password that has already been stored in Active Directory. DO NOT USE this command
394 unless you know exactly what you are doing. The use of this command requires that the force flag (-f)
395 be used also. There will be NO command prompt. Whatever information is piped into stdin, either by
396 typing at the command line or otherwise, will be stored as the literal machine password. Do NOT use
397 this without care and attention as it will overwrite a legitimate machine password without warning.
398 YOU HAVE BEEN WARNED.
406 <para>The <command>NET TIME</command> command allows you to view the time on a remote server
407 or synchronise the time on the local server with the time on the remote server.</para>
412 <para>Without any options, the <command>NET TIME</command> command
413 displays the time on the remote server. The remote server must be
414 specified with the -S option.
420 <title>TIME SYSTEM</title>
422 <para>Displays the time on the remote server in a format ready for <command>/bin/date</command>.
423 The remote server must be specified with the -S option.
429 <title>TIME SET</title>
430 <para>Tries to set the date and time of the local server to that on
431 the remote server using <command>/bin/date</command>.
432 The remote server must be specified with the -S option.
438 <title>TIME ZONE</title>
440 <para>Displays the timezone in hours from GMT on the remote server.
441 The remote server must be specified with the -S option.
448 <title>[RPC|ADS] JOIN [TYPE] [--no-dns-updates] [-U username[%password]]
449 [createupn=UPN] [createcomputer=OU] [machinepass=PASS]
450 [osName=string osVer=string] [options]</title>
453 Join a domain. If the account already exists on the server, and
454 [TYPE] is MEMBER, the machine will attempt to join automatically.
455 (Assuming that the machine has been created in server manager)
456 Otherwise, a password will be prompted for, and a new account may
460 [TYPE] may be PDC, BDC or MEMBER to specify the type of server
465 [UPN] (ADS only) set the principalname attribute during the join. The default
466 format is host/netbiosname@REALM.
470 [OU] (ADS only) Precreate the computer account in a specific OU. The
471 OU string reads from top to bottom without RDNs, and is delimited by
472 a '/'. Please note that '\' is used for escape by both the shell
473 and ldap, so it may need to be doubled or quadrupled to pass through,
474 and it is not used as a delimiter.
477 [PASS] (ADS only) Set a specific password on the computer account
478 being created by the join.
481 [osName=string osVer=String] (ADS only) Set the operatingSystem and
482 operatingSystemVersion attribute during the join. Both parameters
483 must be specified for either to take effect.
488 <title>[RPC] OLDJOIN [options]</title>
490 <para>Join a domain. Use the OLDJOIN option to join the domain
491 using the old style of domain joining - you need to create a trust
492 account in server manager first.</para>
496 <title>[RPC|ADS] USER</title>
499 <title>[RPC|ADS] USER</title>
501 <para>List all users</para>
506 <title>[RPC|ADS] USER DELETE <replaceable>target</replaceable></title>
508 <para>Delete specified user</para>
513 <title>[RPC|ADS] USER INFO <replaceable>target</replaceable></title>
515 <para>List the domain groups of the specified user.</para>
520 <title>[RPC|ADS] USER RENAME <replaceable>oldname</replaceable> <replaceable>newname</replaceable></title>
522 <para>Rename specified user.</para>
527 <title>[RPC|ADS] USER ADD <replaceable>name</replaceable> [password] [-F user flags] [-C comment]</title>
529 <para>Add specified user.</para>
534 <title>[RPC|ADS] GROUP</title>
537 <title>[RPC|ADS] GROUP [misc options] [targets]</title>
538 <para>List user groups.</para>
542 <title>[RPC|ADS] GROUP DELETE <replaceable>name</replaceable> [misc. options]</title>
544 <para>Delete specified group.</para>
549 <title>[RPC|ADS] GROUP ADD <replaceable>name</replaceable> [-C comment]</title>
551 <para>Create specified group.</para>
557 <title>[RAP|RPC] SHARE</title>
560 <title>[RAP|RPC] SHARE [misc. options] [targets]</title>
562 <para>Enumerates all exported resources (network shares) on target server.</para>
567 <title>[RAP|RPC] SHARE ADD <replaceable>name=serverpath</replaceable> [-C comment] [-M maxusers] [targets]</title>
569 <para>Adds a share from a server (makes the export active). Maxusers
570 specifies the number of users that can be connected to the
571 share simultaneously.</para>
576 <title>SHARE DELETE <replaceable>sharename</replaceable></title>
578 <para>Delete specified share.</para>
583 <title>[RPC|RAP] FILE</title>
586 <title>[RPC|RAP] FILE</title>
588 <para>List all open files on remote server.</para>
593 <title>[RPC|RAP] FILE CLOSE <replaceable>fileid</replaceable></title>
595 <para>Close file with specified <replaceable>fileid</replaceable> on
596 remote server.</para>
601 <title>[RPC|RAP] FILE INFO <replaceable>fileid</replaceable></title>
604 Print information on specified <replaceable>fileid</replaceable>.
605 Currently listed are: file-id, username, locks, path, permissions.
611 <title>[RAP|RPC] FILE USER <replaceable>user</replaceable></title>
614 List files opened by specified <replaceable>user</replaceable>.
615 Please note that <command>net rap file user</command> does not work
616 against Samba servers.
624 <title>SESSION</title>
627 <title>RAP SESSION</title>
629 <para>Without any other options, SESSION enumerates all active SMB/CIFS
630 sessions on the target server.</para>
635 <title>RAP SESSION DELETE|CLOSE <replaceable>CLIENT_NAME</replaceable></title>
637 <para>Close the specified sessions.</para>
642 <title>RAP SESSION INFO <replaceable>CLIENT_NAME</replaceable></title>
644 <para>Give a list with all the open files in specified session.</para>
651 <title>RAP SERVER <replaceable>DOMAIN</replaceable></title>
653 <para>List all servers in specified domain or workgroup. Defaults
654 to local domain.</para>
659 <title>RAP DOMAIN</title>
661 <para>Lists all domains and workgroups visible on the
662 current network.</para>
667 <title>RAP PRINTQ</title>
670 <title>RAP PRINTQ INFO <replaceable>QUEUE_NAME</replaceable></title>
672 <para>Lists the specified print queue and print jobs on the server.
673 If the <replaceable>QUEUE_NAME</replaceable> is omitted, all
674 queues are listed.</para>
679 <title>RAP PRINTQ DELETE <replaceable>JOBID</replaceable></title>
681 <para>Delete job with specified id.</para>
688 <title>RAP VALIDATE <replaceable>user</replaceable> [<replaceable>password</replaceable>]</title>
691 Validate whether the specified user can log in to the
692 remote server. If the password is not specified on the commandline, it
701 <title>RAP GROUPMEMBER</title>
704 <title>RAP GROUPMEMBER LIST <replaceable>GROUP</replaceable></title>
706 <para>List all members of the specified group.</para>
711 <title>RAP GROUPMEMBER DELETE <replaceable>GROUP</replaceable> <replaceable>USER</replaceable></title>
713 <para>Delete member from group.</para>
718 <title>RAP GROUPMEMBER ADD <replaceable>GROUP</replaceable> <replaceable>USER</replaceable></title>
720 <para>Add member to group.</para>
727 <title>RAP ADMIN <replaceable>command</replaceable></title>
729 <para>Execute the specified <replaceable>command</replaceable> on
730 the remote server. Only works with OS/2 servers.
738 <title>RAP SERVICE</title>
741 <title>RAP SERVICE START <replaceable>NAME</replaceable> [arguments...]</title>
743 <para>Start the specified service on the remote server. Not implemented yet.</para>
750 <title>RAP SERVICE STOP</title>
752 <para>Stop the specified service on the remote server.</para>
761 <title>RAP PASSWORD <replaceable>USER</replaceable> <replaceable>OLDPASS</replaceable> <replaceable>NEWPASS</replaceable></title>
764 Change password of <replaceable>USER</replaceable> from <replaceable>OLDPASS</replaceable> to <replaceable>NEWPASS</replaceable>.
770 <title>LOOKUP</title>
773 <title>LOOKUP HOST <replaceable>HOSTNAME</replaceable> [<replaceable>TYPE</replaceable>]</title>
776 Lookup the IP address of the given host with the specified type (netbios suffix).
777 The type defaults to 0x20 (workstation).
783 <title>LOOKUP LDAP [<replaceable>DOMAIN</replaceable>]</title>
785 <para>Give IP address of LDAP server of specified <replaceable>DOMAIN</replaceable>. Defaults to local domain.</para>
790 <title>LOOKUP KDC [<replaceable>REALM</replaceable>]</title>
792 <para>Give IP address of KDC for the specified <replaceable>REALM</replaceable>.
793 Defaults to local realm.</para>
798 <title>LOOKUP DC [<replaceable>DOMAIN</replaceable>]</title>
800 <para>Give IP's of Domain Controllers for specified <replaceable>
801 DOMAIN</replaceable>. Defaults to local domain.</para>
806 <title>LOOKUP MASTER <replaceable>DOMAIN</replaceable></title>
808 <para>Give IP of master browser for specified <replaceable>DOMAIN</replaceable>
809 or workgroup. Defaults to local domain.</para>
818 <para>Samba uses a general caching interface called 'gencache'. It
819 can be controlled using 'NET CACHE'.</para>
821 <para>All the timeout parameters support the suffixes:
824 <member>s - Seconds</member>
825 <member>m - Minutes</member>
826 <member>h - Hours</member>
827 <member>d - Days</member>
828 <member>w - Weeks</member>
834 <title>CACHE ADD <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable></title>
836 <para>Add specified key+data to the cache with the given timeout.</para>
841 <title>CACHE DEL <replaceable>key</replaceable></title>
843 <para>Delete key from the cache.</para>
848 <title>CACHE SET <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable></title>
850 <para>Update data of existing cache entry.</para>
855 <title>CACHE SEARCH <replaceable>PATTERN</replaceable></title>
857 <para>Search for the specified pattern in the cache data.</para>
862 <title>CACHE LIST</title>
865 List all current items in the cache.
871 <title>CACHE FLUSH</title>
873 <para>Remove all the current items from the cache.</para>
880 <title>GETLOCALSID [DOMAIN]</title>
882 <para>Prints the SID of the specified domain, or if the parameter is
883 omitted, the SID of the local server.</para>
888 <title>SETLOCALSID S-1-5-21-x-y-z</title>
890 <para>Sets SID for the local server to the specified SID.</para>
895 <title>GETDOMAINSID</title>
897 <para>Prints the local machine SID and the SID of the current
903 <title>SETDOMAINSID</title>
905 <para>Sets the SID of the current domain.</para>
910 <title>GROUPMAP</title>
912 <para>Manage the mappings between Windows group SIDs and UNIX groups.
913 Common options include:</para>
916 <listitem><para>unixgroup - Name of the UNIX group</para></listitem>
917 <listitem><para>ntgroup - Name of the Windows NT group (must be
918 resolvable to a SID</para></listitem>
919 <listitem><para>rid - Unsigned 32-bit integer</para></listitem>
920 <listitem><para>sid - Full SID in the form of "S-1-..."</para></listitem>
921 <listitem><para>type - Type of the group; either 'domain', 'local',
922 or 'builtin'</para></listitem>
923 <listitem><para>comment - Freeform text description of the group</para></listitem>
927 <title>GROUPMAP ADD</title>
930 Add a new group mapping entry:
932 net groupmap add {rid=int|sid=string} unixgroup=string \
933 [type={domain|local}] [ntgroup=string] [comment=string]
940 <title>GROUPMAP DELETE</title>
942 <para>Delete a group mapping entry. If more than one group name matches, the first entry found is deleted.</para>
944 <para>net groupmap delete {ntgroup=string|sid=SID}</para>
949 <title>GROUPMAP MODIFY</title>
951 <para>Update an existing group entry.</para>
955 net groupmap modify {ntgroup=string|sid=SID} [unixgroup=string] \
956 [comment=string] [type={domain|local}]
962 <title>GROUPMAP LIST</title>
964 <para>List existing group mapping entries.</para>
966 <para>net groupmap list [verbose] [ntgroup=string] [sid=SID]</para>
974 <title>MAXRID</title>
976 <para>Prints out the highest RID currently in use on the local
977 server (by the active 'passdb backend').
983 <title>RPC INFO</title>
985 <para>Print information about the domain of the remote server,
986 such as domain name, domain sid and number of users and groups.
992 <title>[RPC|ADS] TESTJOIN</title>
994 <para>Check whether participation in a domain is still valid.</para>
999 <title>[RPC|ADS] CHANGETRUSTPW</title>
1001 <para>Force change of domain trust password.</para>
1006 <title>RPC TRUSTDOM</title>
1009 <title>RPC TRUSTDOM ADD <replaceable>DOMAIN</replaceable></title>
1011 <para>Add a interdomain trust account for <replaceable>DOMAIN</replaceable>.
1012 This is in fact a Samba account named <replaceable>DOMAIN$</replaceable>
1013 with the account flag <constant>'I'</constant> (interdomain trust account).
1014 This is required for incoming trusts to work. It makes Samba be a
1015 trusted domain of the foreign (trusting) domain.
1016 Users of the Samba domain will be made available in the foreign domain.
1017 If the command is used against localhost it has the same effect as
1018 <command>smbpasswd -a -i DOMAIN</command>. Please note that both commands
1019 expect a appropriate UNIX account.
1025 <title>RPC TRUSTDOM DEL <replaceable>DOMAIN</replaceable></title>
1027 <para>Remove interdomain trust account for
1028 <replaceable>DOMAIN</replaceable>. If it is used against localhost
1029 it has the same effect as <command>smbpasswd -x DOMAIN$</command>.
1035 <title>RPC TRUSTDOM ESTABLISH <replaceable>DOMAIN</replaceable></title>
1038 Establish a trust relationship to a trusted domain.
1039 Interdomain account must already be created on the remote PDC.
1040 This is required for outgoing trusts to work. It makes Samba be a
1041 trusting domain of a foreign (trusted) domain.
1042 Users of the foreign domain will be made available in our domain.
1043 You'll need winbind and a working idmap config to make them
1044 appear in your system.
1050 <title>RPC TRUSTDOM REVOKE <replaceable>DOMAIN</replaceable></title>
1051 <para>Abandon relationship to trusted domain</para>
1056 <title>RPC TRUSTDOM LIST</title>
1058 <para>List all interdomain trust relationships.</para>
1064 <title>RPC TRUST</title>
1067 <title>RPC TRUST CREATE</title>
1069 <para>Create a trust object by calling lsaCreateTrustedDomainEx2.
1070 The can be done on a single server or on two servers at once with the
1071 possibility to use a random trust password.</para>
1073 <variablelist><title>Options:</title>
1075 <term>otherserver</term>
1076 <listitem><para>Domain controller of the second domain</para></listitem>
1080 <term>otheruser</term>
1081 <listitem><para>Admin user in the second domain</para></listitem>
1085 <term>otherdomainsid</term>
1086 <listitem><para>SID of the second domain</para></listitem>
1090 <term>other_netbios_domain</term>
1091 <listitem><para>NetBIOS (short) name of the second domain</para></listitem>
1095 <term>otherdomain</term>
1096 <listitem><para>DNS (full) name of the second domain</para></listitem>
1100 <term>trustpw</term>
1101 <listitem><para>Trust password</para></listitem>
1105 <variablelist><title>Examples:</title>
1107 <term>Create a trust object on srv1.dom1.dom for the domain dom2</term>
1108 <listitem><literallayout>
1109 net rpc trust create \
1110 otherdomainsid=S-x-x-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxx \
1111 other_netbios_domain=dom2 \
1112 otherdomain=dom2.dom \
1115 </literallayout></listitem>
1118 <term>Create a trust relationship between dom1 and dom2</term>
1119 <listitem><literallayout>
1120 net rpc trust create \
1121 otherserver=srv2.dom2.test \
1124 </literallayout></listitem>
1130 <title>RPC TRUST DELETE</title>
1132 <para>Delete a trust object by calling lsaDeleteTrustedDomain.
1133 The can be done on a single server or on two servers at once.</para>
1135 <variablelist><title>Options:</title>
1137 <term>otherserver</term>
1138 <listitem><para>Domain controller of the second domain</para></listitem>
1142 <term>otheruser</term>
1143 <listitem><para>Admin user in the second domain</para></listitem>
1147 <term>otherdomainsid</term>
1148 <listitem><para>SID of the second domain</para></listitem>
1152 <variablelist><title>Examples:</title>
1154 <term>Delete a trust object on srv1.dom1.dom for the domain dom2</term>
1155 <listitem><literallayout>
1156 net rpc trust delete \
1157 otherdomainsid=S-x-x-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxx \
1159 </literallayout></listitem>
1162 <term>Delete a trust relationship between dom1 and dom2</term>
1163 <listitem><literallayout>
1164 net rpc trust delete \
1165 otherserver=srv2.dom2.test \
1168 </literallayout></listitem>
1177 <title>RPC RIGHTS</title>
1179 <para>This subcommand is used to view and manage Samba's rights assignments (also
1180 referred to as privileges). There are three options currently available:
1181 <parameter>list</parameter>, <parameter>grant</parameter>, and
1182 <parameter>revoke</parameter>. More details on Samba's privilege model and its use
1183 can be found in the Samba-HOWTO-Collection.</para>
1191 <title>RPC ABORTSHUTDOWN</title>
1193 <para>Abort the shutdown of a remote server.</para>
1198 <title>RPC SHUTDOWN [-t timeout] [-r] [-f] [-C message]</title>
1200 <para>Shut down the remote server.</para>
1206 Reboot after shutdown.
1213 Force shutting down all applications.
1218 <term>-t timeout</term>
1220 Timeout before system will be shut down. An interactive
1221 user of the system can use this time to cancel the shutdown.
1226 <term>-C message</term>
1227 <listitem><para>Display the specified message on the screen to
1228 announce the shutdown.</para></listitem>
1235 <title>RPC SAMDUMP</title>
1237 <para>Print out sam database of remote server. You need
1238 to run this against the PDC, from a Samba machine joined as a BDC. </para>
1242 <title>RPC VAMPIRE</title>
1244 <para>Export users, aliases and groups from remote server to
1245 local server. You need to run this against the PDC, from a Samba machine joined as a BDC.
1246 This vampire command cannot be used against an Active Directory, only
1247 against an NT4 Domain Controller.
1252 <title>RPC VAMPIRE KEYTAB</title>
1254 <para>Dump remote SAM database to local Kerberos keytab file.
1259 <title>RPC VAMPIRE LDIF</title>
1261 <para>Dump remote SAM database to local LDIF file or standard output.
1266 <title>RPC GETSID</title>
1268 <para>Fetch domain SID and store it in the local <filename>secrets.tdb</filename>. </para>
1273 <title>ADS LEAVE</title>
1275 <para>Make the remote host leave the domain it is part of. </para>
1280 <title>ADS STATUS</title>
1282 <para>Print out status of machine account of the local machine in ADS.
1283 Prints out quite some debug info. Aimed at developers, regular
1284 users should use <command>NET ADS TESTJOIN</command>.</para>
1289 <title>ADS PRINTER</title>
1292 <title>ADS PRINTER INFO [<replaceable>PRINTER</replaceable>] [<replaceable>SERVER</replaceable>]</title>
1295 Lookup info for <replaceable>PRINTER</replaceable> on <replaceable>SERVER</replaceable>. The printer name defaults to "*", the
1296 server name defaults to the local host.</para>
1301 <title>ADS PRINTER PUBLISH <replaceable>PRINTER</replaceable></title>
1303 <para>Publish specified printer using ADS.</para>
1308 <title>ADS PRINTER REMOVE <replaceable>PRINTER</replaceable></title>
1310 <para>Remove specified printer from ADS directory.</para>
1317 <title>ADS SEARCH <replaceable>EXPRESSION</replaceable> <replaceable>ATTRIBUTES...</replaceable></title>
1319 <para>Perform a raw LDAP search on a ADS server and dump the results. The
1320 expression is a standard LDAP search expression, and the
1321 attributes are a list of LDAP fields to show in the results.</para>
1323 <para>Example: <userinput>net ads search '(objectCategory=group)' sAMAccountName</userinput>
1329 <title>ADS DN <replaceable>DN</replaceable> <replaceable>(attributes)</replaceable></title>
1332 Perform a raw LDAP search on a ADS server and dump the results. The
1333 DN standard LDAP DN, and the attributes are a list of LDAP fields
1334 to show in the result.
1337 <para>Example: <userinput>net ads dn 'CN=administrator,CN=Users,DC=my,DC=domain' SAMAccountName</userinput></para>
1342 <title>ADS KEYTAB <replaceable>CREATE</replaceable></title>
1345 Creates a new keytab file if one doesn't exist with default entries. Default
1346 entries are kerberos principals created from the machinename of the
1347 client, the UPN (if it exists) and any Windows SPN(s) associated with the
1348 computer AD account for the client. If a keytab file already exists then only
1349 missing kerberos principals from the default entries are added. No changes
1350 are made to the computer AD account.
1355 <title>ADS KEYTAB <replaceable>ADD</replaceable> <replaceable>(principal | machine | serviceclass | windows SPN</replaceable></title>
1358 Adds a new keytab entry, the entry can be either;
1360 <varlistentry><term>kerberos principal</term>
1362 A kerberos principal (identified by the presence of '@') is just
1363 added to the keytab file.
1366 <varlistentry><term>machinename</term>
1368 A machinename (identified by the trailing '$') is used to create a
1369 a kerberos principal 'machinename@realm' which is added to the
1373 <varlistentry><term>serviceclass</term>
1375 A serviceclass (such as 'cifs', 'html' etc.) is used to create a pair
1376 of kerberos principals 'serviceclass/fully_qualified_dns_name@realm' &
1377 'serviceclass/netbios_name@realm' which are added to the keytab file.
1380 <varlistentry><term>Windows SPN</term>
1382 A Windows SPN is of the format 'serviceclass/host:port', it is used to
1383 create a kerberos principal 'serviceclass/host@realm' which will
1384 be written to the keytab file.
1390 Unlike old versions no computer AD objects are modified by this command. To
1391 preserve the bevhaviour of older clients 'net ads keytab ad_update_ads' is
1397 <title>ADS KEYTAB <replaceable>ADD_UPDATE_ADS</replaceable> <replaceable>(principal | machine | serviceclass | windows SPN</replaceable></title>
1400 Adds a new keytab entry (see section for net ads keytab add). In addition to
1401 adding entries to the keytab file corrosponding Windows SPNs are created
1402 from the entry passed to this command. These SPN(s) added to the AD computer
1403 account object associated with the client machine running this command for
1404 the following entry types;
1406 <varlistentry><term>serviceclass</term>
1408 A serviceclass (such as 'cifs', 'html' etc.) is used to create a
1409 pair of Windows SPN(s) 'param/full_qualified_dns' &
1410 'param/netbios_name' which are added to the AD computer account object
1414 <varlistentry><term>Windows SPN</term>
1416 A Windows SPN is of the format 'serviceclass/host:port', it is
1417 added as passed to the AD computer account object for this client.
1425 <title>ADS setspn <replaceable>SETSPN LIST [machine]</replaceable></title>
1428 Lists the Windows SPNs stored in the 'machine' Windows AD Computer object.
1429 If 'machine' is not specified then computer account for this client is used
1435 <title>ADS setspn <replaceable>SETSPN ADD SPN [machine]</replaceable></title>
1438 Adds the specified Windows SPN to the 'machine' Windows AD Computer object.
1439 If 'machine' is not specified then computer account for this client is used
1446 <title>ADS setspn <replaceable>SETSPN DELETE SPN [machine]</replaceable></title>
1449 DELETE the specified Window SPN from the 'machine' Windows AD Computer
1450 object. If 'machine' is not specified then computer account for this
1458 <title>ADS WORKGROUP</title>
1460 <para>Print out workgroup name for specified kerberos realm.</para>
1465 <title>ADS ENCTYPES</title>
1468 List, modify or delete the value of the "msDS-SupportedEncryptionTypes" attribute of an account in AD.
1472 This attribute allows one to control which Kerberos encryption types are used for the generation of initial and service tickets. The value consists of an integer bitmask with the following values:
1475 <para>0x00000001 DES-CBC-CRC</para>
1476 <para>0x00000002 DES-CBC-MD5</para>
1477 <para>0x00000004 RC4-HMAC</para>
1478 <para>0x00000008 AES128-CTS-HMAC-SHA1-96</para>
1479 <para>0x00000010 AES256-CTS-HMAC-SHA1-96</para>
1484 <title>ADS ENCTYPES LIST <replaceable><ACCOUNTNAME></replaceable></title>
1487 List the value of the "msDS-SupportedEncryptionTypes" attribute of a given account.
1490 <para>Example: <userinput>net ads enctypes list Computername</userinput></para>
1495 <title>ADS ENCTYPES SET <replaceable><ACCOUNTNAME></replaceable> <replaceable>[enctypes]</replaceable></title>
1498 Set the value of the "msDS-SupportedEncryptionTypes" attribute of the LDAP object of ACCOUNTNAME to a given value. If the value is omitted, the value is set to 31 which enables all the currently supported encryption types.
1501 <para>Example: <userinput>net ads enctypes set Computername 24</userinput></para>
1506 <title>ADS ENCTYPES DELETE <replaceable><ACCOUNTNAME></replaceable></title>
1509 Deletes the "msDS-SupportedEncryptionTypes" attribute of the LDAP object of ACCOUNTNAME.
1512 <para>Example: <userinput>net ads enctypes set Computername 24</userinput></para>
1518 <title>SAM CREATEBUILTINGROUP <NAME></title>
1521 (Re)Create a BUILTIN group.
1522 Only a wellknown set of BUILTIN groups can be created with this command.
1523 This is the list of currently recognized group names: Administrators,
1524 Users, Guests, Power Users, Account Operators, Server Operators, Print
1525 Operators, Backup Operators, Replicator, RAS Servers, Pre-Windows 2000
1528 This command requires a running Winbindd with idmap allocation properly
1529 configured. The group gid will be allocated out of the winbindd range.
1535 <title>SAM CREATELOCALGROUP <NAME></title>
1538 Create a LOCAL group (also known as Alias).
1540 This command requires a running Winbindd with idmap allocation properly
1541 configured. The group gid will be allocated out of the winbindd range.
1547 <title>SAM DELETELOCALGROUP <NAME></title>
1550 Delete an existing LOCAL group (also known as Alias).
1557 <title>SAM MAPUNIXGROUP <NAME></title>
1560 Map an existing Unix group and make it a Domain Group, the domain group
1561 will have the same name.
1567 <title>SAM UNMAPUNIXGROUP <NAME></title>
1570 Remove an existing group mapping entry.
1576 <title>SAM ADDMEM <GROUP> <MEMBER></title>
1579 Add a member to a Local group. The group can be specified only by name,
1580 the member can be specified by name or SID.
1586 <title>SAM DELMEM <GROUP> <MEMBER></title>
1589 Remove a member from a Local group. The group and the member must be
1596 <title>SAM LISTMEM <GROUP></title>
1599 List Local group members. The group must be specified by name.
1605 <title>SAM LIST <users|groups|localgroups|builtin|workstations> [verbose]</title>
1608 List the specified set of accounts by name. If verbose is specified,
1609 the rid and description is also provided for each account.
1615 <title>SAM RIGHTS LIST</title>
1618 List all available privileges.
1624 <title>SAM RIGHTS GRANT <NAME> <PRIVILEGE></title>
1627 Grant one or more privileges to a user.
1633 <title>SAM RIGHTS REVOKE <NAME> <PRIVILEGE></title>
1636 Revoke one or more privileges from a user.
1642 <title>SAM SHOW <NAME></title>
1645 Show the full DOMAIN\\NAME the SID and the type for the corresponding
1652 <title>SAM SET HOMEDIR <NAME> <DIRECTORY></title>
1655 Set the home directory for a user account.
1661 <title>SAM SET PROFILEPATH <NAME> <PATH></title>
1664 Set the profile path for a user account.
1670 <title>SAM SET COMMENT <NAME> <COMMENT></title>
1673 Set the comment for a user or group account.
1679 <title>SAM SET FULLNAME <NAME> <FULL NAME></title>
1682 Set the full name for a user account.
1688 <title>SAM SET LOGONSCRIPT <NAME> <SCRIPT></title>
1691 Set the logon script for a user account.
1697 <title>SAM SET HOMEDRIVE <NAME> <DRIVE></title>
1700 Set the home drive for a user account.
1706 <title>SAM SET WORKSTATIONS <NAME> <WORKSTATIONS></title>
1709 Set the workstations a user account is allowed to log in from.
1715 <title>SAM SET DISABLE <NAME></title>
1718 Set the "disabled" flag for a user account.
1724 <title>SAM SET PWNOTREQ <NAME></title>
1727 Set the "password not required" flag for a user account.
1733 <title>SAM SET AUTOLOCK <NAME></title>
1736 Set the "autolock" flag for a user account.
1742 <title>SAM SET PWNOEXP <NAME></title>
1745 Set the "password do not expire" flag for a user account.
1751 <title>SAM SET PWDMUSTCHANGENOW <NAME> [yes|no]</title>
1754 Set or unset the "password must change" flag for a user account.
1760 <title>SAM POLICY LIST</title>
1763 List the available account policies.
1769 <title>SAM POLICY SHOW <account policy></title>
1772 Show the account policy value.
1778 <title>SAM POLICY SET <account policy> <value></title>
1781 Set a value for the account policy.
1782 Valid values can be: "forever", "never", "off", or a number.
1788 <title>SAM PROVISION</title>
1791 Only available if ldapsam:editposix is set and winbindd is running.
1792 Properly populates the ldap tree with the basic accounts (Administrator)
1793 and groups (Domain Users, Domain Admins, Domain Guests) on the ldap tree.
1799 <title>IDMAP DUMP <local tdb file name></title>
1802 Dumps the mappings contained in the local tdb file specified.
1803 This command is useful to dump only the mappings produced by the idmap_tdb backend.
1809 <title>IDMAP RESTORE [input file]</title>
1812 Restore the mappings from the specified file or stdin.
1818 <title>IDMAP SET SECRET <DOMAIN> <secret></title>
1821 Store a secret for the specified domain, used primarily for domains
1822 that use idmap_ldap as a backend. In this case the secret is used
1823 as the password for the user DN used to bind to the ldap server.
1829 <title>IDMAP SET RANGE <RANGE> <SID> [index] [--db=<DB>]</title>
1832 Store a domain-range mapping for a given domain (and index) in autorid database.
1838 <title>IDMAP SET CONFIG <config> [--db=<DB>]</title>
1841 Update CONFIG entry in autorid database.
1847 <title>IDMAP GET RANGE <SID> [index] [--db=<DB>]</title>
1850 Get the range for a given domain and index from autorid database.
1856 <title>IDMAP GET RANGES [<SID>] [--db=<DB>]</title>
1859 Get ranges for all domains or for one identified by given SID.
1865 <title>IDMAP GET CONFIG [--db=<DB>]</title>
1868 Get CONFIG entry from autorid database.
1875 <title>IDMAP DELETE MAPPING [-f] [--db=<DB>] <ID></title>
1878 Delete a mapping sid <-> gid or sid <-> uid from the IDMAP database.
1879 The mapping is given by <ID> which may either be a sid: S-x-..., a gid: "GID number" or a uid: "UID number".
1880 Use -f to delete an invalid partial mapping <ID> -> xx
1883 Use "smbcontrol all idmap ..." to notify running smbd instances.
1884 See the <citerefentry><refentrytitle>smbcontrol</refentrytitle>
1885 <manvolnum>1</manvolnum></citerefentry> manpage for details.
1890 <title>IDMAP DELETE RANGE [-f] [--db=<TDB>] <RANGE>|(<SID> [<INDEX>])</title>
1893 Delete a domain range mapping identified by 'RANGE' or "domain SID and INDEX" from autorid database.
1894 Use -f to delete invalid mappings.
1900 <title>IDMAP DELETE RANGES [-f] [--db=<TDB>] <SID></title>
1903 Delete all domain range mappings for a domain identified by SID.
1904 Use -f to delete invalid mappings.
1911 <title>IDMAP CHECK [-v] [-r] [-a] [-T] [-f] [-l] [--db=<DB>]</title>
1914 Check and repair the IDMAP database. If no option is given a read only check
1915 of the database is done. Among others an interactive or automatic repair mode
1916 may be chosen with one of the following options:
1919 <varlistentry><term>-r|--repair</term>
1921 Interactive repair mode, ask a lot of questions.
1925 <varlistentry><term>-a|--auto</term>
1927 Noninteractive repair mode, use default answers.
1931 <varlistentry><term>-v|--verbose</term>
1933 Produce more output.
1937 <varlistentry><term>-f|--force</term>
1939 Try to apply changes, even if they do not apply cleanly.
1943 <varlistentry><term>-T|--test</term>
1945 Dry run, show what changes would be made but don't touch anything.
1949 <varlistentry><term>-l|--lock</term>
1951 Lock the database while doing the check.
1955 <varlistentry><term>--db <DB></term>
1957 Check the specified database.
1960 <varlistentry><term></term>
1966 It reports about the finding of the following errors:
1969 <varlistentry><term>Missing reverse mapping:</term>
1971 A record with mapping A->B where there is no B->A. Default action
1972 in repair mode is to "fix" this by adding the reverse mapping.
1976 <varlistentry><term>Invalid mapping:</term>
1978 A record with mapping A->B where B->C. Default action
1979 is to "delete" this record.
1983 <varlistentry><term>Missing or invalid HWM:</term>
1985 A high water mark is not at least equal to the largest ID in the
1986 database. Default action is to "fix" this by setting it to the
1987 largest ID found +1.
1991 <varlistentry><term>Invalid record:</term>
1993 Something we failed to parse. Default action is to "edit" it
1994 in interactive and "delete" it in automatic mode.
2003 <title>USERSHARE</title>
2005 <para>Starting with version 3.0.23, a Samba server now supports the ability for
2006 non-root users to add user defined shares to be exported using the "net usershare"
2011 To set this up, first set up your smb.conf by adding to the [global] section:
2013 usershare path = /usr/local/samba/lib/usershares
2015 Next create the directory /usr/local/samba/lib/usershares, change the owner to root and
2016 set the group owner to the UNIX group who should have the ability to create usershares,
2017 for example a group called "serverops".
2019 Set the permissions on /usr/local/samba/lib/usershares to 01770.
2021 (Owner and group all access, no access for others, plus the sticky bit,
2022 which means that a file in that directory can be renamed or deleted only
2023 by the owner of the file).
2025 Finally, tell smbd how many usershares you will allow by adding to the [global]
2026 section of smb.conf a line such as :
2028 usershare max shares = 100.
2030 To allow 100 usershare definitions. Now, members of the UNIX group "serverops"
2031 can create user defined shares on demand using the commands below.
2034 <para>The usershare commands are:
2037 <member>net usershare add sharename path [comment [acl] [guest_ok=[y|n]]] - to add or change a user defined share.</member>
2038 <member>net usershare delete sharename - to delete a user defined share.</member>
2039 <member>net usershare info [-l|--long] [wildcard sharename] - to print info about a user defined share.</member>
2040 <member>net usershare list [-l|--long] [wildcard sharename] - to list user defined shares.</member>
2046 <title>USERSHARE ADD <replaceable>sharename</replaceable> <replaceable>path</replaceable> <replaceable>[comment]</replaceable> <replaceable>[acl]</replaceable> <replaceable>[guest_ok=[y|n]]</replaceable></title>
2049 Add or replace a new user defined share, with name "sharename".
2053 "path" specifies the absolute pathname on the system to be exported.
2054 Restrictions may be put on this, see the global smb.conf parameters:
2055 "usershare owner only", "usershare prefix allow list", and
2056 "usershare prefix deny list".
2060 The optional "comment" parameter is the comment that will appear
2061 on the share when browsed to by a client.
2064 <para>The optional "acl" field
2065 specifies which users have read and write access to the entire share.
2066 Note that guest connections are not allowed unless the smb.conf parameter
2067 "usershare allow guests" has been set. The definition of a user
2068 defined share acl is: "user:permission", where user is a valid
2069 username on the system and permission can be "F", "R", or "D".
2070 "F" stands for "full permissions", ie. read and write permissions.
2071 "D" stands for "deny" for a user, ie. prevent this user from accessing
2073 "R" stands for "read only", ie. only allow read access to this
2074 share (no creation of new files or directories or writing to files).
2078 The default if no "acl" is given is "Everyone:R", which means any
2079 authenticated user has read-only access.
2083 The optional "guest_ok" has the same effect as the parameter of the
2084 same name in smb.conf, in that it allows guest access to this user
2085 defined share. This parameter is only allowed if the global parameter
2086 "usershare allow guests" has been set to true in the smb.conf.
2089 There is no separate command to modify an existing user defined share,
2090 just use the "net usershare add [sharename]" command using the same
2091 sharename as the one you wish to modify and specify the new options
2092 you wish. The Samba smbd daemon notices user defined share modifications
2093 at connect time so will see the change immediately, there is no need
2094 to restart smbd on adding, deleting or changing a user defined share.
2098 <title>USERSHARE DELETE <replaceable>sharename</replaceable></title>
2101 Deletes the user defined share by name. The Samba smbd daemon
2102 immediately notices this change, although it will not disconnect
2103 any users currently connected to the deleted share.
2109 <title>USERSHARE INFO <replaceable>[-l|--long]</replaceable> <replaceable>[wildcard sharename]</replaceable></title>
2112 Get info on user defined shares owned by the current user matching the given pattern, or all users.
2116 net usershare info on its own dumps out info on the user defined shares that were
2117 created by the current user, or restricts them to share names that match the given
2118 wildcard pattern ('*' matches one or more characters, '?' matches only one character).
2119 If the '-l' or '--long' option is also given, it prints out info on user defined
2120 shares created by other users.
2124 The information given about a share looks like:
2129 usershare_acl=Everyone:F
2132 And is a list of the current settings of the user defined share that can be
2133 modified by the "net usershare add" command.
2139 <title>USERSHARE LIST <replaceable>[-l|--long]</replaceable> <replaceable>wildcard sharename</replaceable></title>
2142 List all the user defined shares owned by the current user matching the given pattern, or all users.
2146 net usershare list on its own list out the names of the user defined shares that were
2147 created by the current user, or restricts the list to share names that match the given
2148 wildcard pattern ('*' matches one or more characters, '?' matches only one character).
2149 If the '-l' or '--long' option is also given, it includes the names of user defined
2150 shares created by other users.
2158 <title>[RPC] CONF</title>
2160 <para>Starting with version 3.2.0, a Samba server can be configured by data
2161 stored in registry. This configuration data can be edited with the new "net
2162 conf" commands. There is also the possibility to configure a remote Samba server
2163 by enabling the RPC conf mode and specifying the address of the remote server.
2167 The deployment of this configuration data can be activated in two levels from the
2168 <emphasis>smb.conf</emphasis> file: Share definitions from registry are
2169 activated by setting <parameter>registry shares</parameter> to
2170 <quote>yes</quote> in the [global] section and global configuration options are
2171 activated by setting <smbconfoption name="include">registry</smbconfoption> in
2172 the [global] section for a mixed configuration or by setting
2173 <smbconfoption name="config backend">registry</smbconfoption> in the [global]
2174 section for a registry-only configuration.
2175 See the <citerefentry><refentrytitle>smb.conf</refentrytitle>
2176 <manvolnum>5</manvolnum></citerefentry> manpage for details.
2179 <para>The conf commands are:
2181 <member>net [rpc] conf list - Dump the complete configuration in smb.conf like
2183 <member>net [rpc] conf import - Import configuration from file in smb.conf
2185 <member>net [rpc] conf listshares - List the registry shares.</member>
2186 <member>net [rpc] conf drop - Delete the complete configuration from
2188 <member>net [rpc] conf showshare - Show the definition of a registry share.</member>
2189 <member>net [rpc] conf addshare - Create a new registry share.</member>
2190 <member>net [rpc] conf delshare - Delete a registry share.</member>
2191 <member>net [rpc] conf setparm - Store a parameter.</member>
2192 <member>net [rpc] conf getparm - Retrieve the value of a parameter.</member>
2193 <member>net [rpc] conf delparm - Delete a parameter.</member>
2194 <member>net [rpc] conf getincludes - Show the includes of a share definition.</member>
2195 <member>net [rpc] conf setincludes - Set includes for a share.</member>
2196 <member>net [rpc] conf delincludes - Delete includes from a share definition.</member>
2201 <title>[RPC] CONF LIST</title>
2204 Print the configuration data stored in the registry in a smb.conf-like format to
2210 <title>[RPC] CONF IMPORT <replaceable>[--test|-T]</replaceable> <replaceable>filename</replaceable> <replaceable>[section]</replaceable></title>
2213 This command imports configuration from a file in smb.conf format.
2214 If a section encountered in the input file is present in registry,
2215 its contents is replaced. Sections of registry configuration that have
2216 no counterpart in the input file are not affected. If you want to delete these,
2217 you will have to use the "net conf drop" or "net conf delshare" commands.
2218 Optionally, a section may be specified to restrict the effect of the
2219 import command to that specific section. A test mode is enabled by specifying
2220 the parameter "-T" on the commandline. In test mode, no changes are made to the
2221 registry, and the resulting configuration is printed to standard output instead.
2226 <title>[RPC] CONF LISTSHARES</title>
2229 List the names of the shares defined in registry.
2234 <title>[RPC] CONF DROP</title>
2237 Delete the complete configuration data from registry.
2242 <title>[RPC] CONF SHOWSHARE <replaceable>sharename</replaceable></title>
2245 Show the definition of the share or section specified. It is valid to specify
2246 "global" as sharename to retrieve the global configuration options from
2252 <title>[RPC] CONF ADDSHARE <replaceable>sharename</replaceable> <replaceable>path</replaceable> [<replaceable>writeable={y|N}</replaceable> [<replaceable>guest_ok={y|N}</replaceable> [<replaceable>comment</replaceable>]]] </title>
2254 <para>Create a new share definition in registry.
2255 The sharename and path have to be given. The share name may
2256 <emphasis>not</emphasis> be "global". Optionally, values for the very
2257 common options "writeable", "guest ok" and a "comment" may be specified.
2258 The same result may be obtained by a sequence of "net conf setparm"
2264 <title>[RPC] CONF DELSHARE <replaceable>sharename</replaceable></title>
2267 Delete a share definition from registry.
2272 <title>[RPC] CONF SETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable> <replaceable>value</replaceable></title>
2275 Store a parameter in registry. The section may be global or a sharename.
2276 The section is created if it does not exist yet.
2281 <title>[RPC] CONF GETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
2284 Show a parameter stored in registry.
2289 <title>[RPC] CONF DELPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
2292 Delete a parameter stored in registry.
2297 <title>[RPC] CONF GETINCLUDES <replaceable>section</replaceable></title>
2300 Get the list of includes for the provided section (global or share).
2304 Note that due to the nature of the registry database and the nature of include directives,
2305 the includes need special treatment: Parameters are stored in registry by the parameter
2306 name as valuename, so there is only ever one instance of a parameter per share.
2307 Also, a specific order like in a text file is not guaranteed. For all real
2308 parameters, this is perfectly ok, but the include directive is rather a meta
2309 parameter, for which, in the smb.conf text file, the place where it is specified
2310 between the other parameters is very important. This can not be achieved by the
2311 simple registry smbconf data model, so there is one ordered list of includes
2312 per share, and this list is evaluated after all the parameters of the share.
2316 Further note that currently, only files can be included from registry
2317 configuration. In the future, there will be the ability to include configuration
2318 data from other registry keys.
2323 <title>[RPC] CONF SETINCLUDES <replaceable>section</replaceable> [<replaceable>filename</replaceable>]+</title>
2326 Set the list of includes for the provided section (global or share) to the given
2327 list of one or more filenames. The filenames may contain the usual smb.conf
2333 <title>[RPC] CONF DELINCLUDES <replaceable>section</replaceable></title>
2336 Delete the list of includes from the provided section (global or share).
2343 <title>REGISTRY</title>
2345 Manipulate Samba's registry.
2348 <para>The registry commands are:
2350 <member>net registry enumerate - Enumerate registry keys and values.</member>
2351 <member>net registry enumerate_recursive - Enumerate registry key and its subkeys.</member>
2352 <member>net registry createkey - Create a new registry key.</member>
2353 <member>net registry deletekey - Delete a registry key.</member>
2354 <member>net registry deletekey_recursive - Delete a registry key with subkeys.</member>
2355 <member>net registry getvalue - Print a registry value.</member>
2356 <member>net registry getvalueraw - Print a registry value (raw format).</member>
2357 <member>net registry setvalue - Set a new registry value.</member>
2358 <member>net registry increment - Increment a DWORD registry value under a lock.
2360 <member>net registry deletevalue - Delete a registry value.</member>
2361 <member>net registry getsd - Get security descriptor.</member>
2362 <member>net registry getsd_sdd1 - Get security descriptor in sddl format.
2364 <member>net registry setsd_sdd1 - Set security descriptor from sddl format
2366 <member>net registry import - Import a registration entries (.reg) file.
2368 <member>net registry export - Export a registration entries (.reg) file.
2370 <member>net registry convert - Convert a registration entries (.reg) file.
2372 <member>net registry check - Check and repair a registry database.
2378 <title>REGISTRY ENUMERATE <replaceable>key</replaceable> </title>
2379 <para>Enumerate subkeys and values of <emphasis>key</emphasis>.
2384 <title>REGISTRY ENUMERATE_RECURSIVE <replaceable>key</replaceable> </title>
2385 <para>Enumerate values of <emphasis>key</emphasis> and its subkeys.
2390 <title>REGISTRY CREATEKEY <replaceable>key</replaceable> </title>
2391 <para>Create a new <emphasis>key</emphasis> if not yet existing.
2396 <title>REGISTRY DELETEKEY <replaceable>key</replaceable> </title>
2397 <para>Delete the given <emphasis>key</emphasis> and its
2398 values from the registry, if it has no subkeys.
2403 <title>REGISTRY DELETEKEY_RECURSIVE <replaceable>key</replaceable> </title>
2404 <para>Delete the given <emphasis>key</emphasis> and all of its
2405 subkeys and values from the registry.
2410 <title>REGISTRY GETVALUE <replaceable>key</replaceable> <!--
2411 --><replaceable>name</replaceable></title>
2413 <para>Output type and actual value of the value <emphasis>name</emphasis>
2414 of the given <emphasis>key</emphasis>.
2419 <title>REGISTRY GETVALUERAW <replaceable>key</replaceable> <!--
2420 --><replaceable>name</replaceable></title>
2421 <para>Output the actual value of the value <emphasis>name</emphasis>
2422 of the given <emphasis>key</emphasis>.
2427 <title>REGISTRY SETVALUE <replaceable>key</replaceable> <!--
2428 --><replaceable>name</replaceable> <replaceable>type</replaceable> <!--
2429 --><replaceable>value</replaceable> ...<!--
2432 <para>Set the value <emphasis>name</emphasis>
2433 of an existing <emphasis>key</emphasis>.
2434 <emphasis>type</emphasis> may be one of
2435 <emphasis>sz</emphasis>, <emphasis>multi_sz</emphasis> or
2436 <emphasis>dword</emphasis>.
2437 In case of <emphasis>multi_sz</emphasis> <replaceable>value</replaceable> may
2438 be given multiple times.
2443 <title>REGISTRY INCREMENT <replaceable>key</replaceable> <!--
2444 --><replaceable>name</replaceable> <replaceable>[inc]</replaceable><!--
2447 <para>Increment the DWORD value <emphasis>name</emphasis>
2448 of <emphasis>key</emphasis> by <replaceable>inc</replaceable>
2449 while holding a g_lock.
2450 <emphasis>inc</emphasis> defaults to 1.
2455 <title>REGISTRY DELETEVALUE <replaceable>key</replaceable> <!--
2456 --><replaceable>name</replaceable></title>
2458 <para>Delete the value <emphasis>name</emphasis>
2459 of the given <emphasis>key</emphasis>.
2464 <title>REGISTRY GETSD <replaceable>key</replaceable></title>
2466 <para>Get the security descriptor of the given <emphasis>key</emphasis>.
2471 <title>REGISTRY GETSD_SDDL <replaceable>key</replaceable></title>
2473 <para>Get the security descriptor of the given <emphasis>key</emphasis> as a
2474 Security Descriptor Definition Language (SDDL) string.
2479 <title>REGISTRY SETSD_SDDL <replaceable>key</replaceable><!--
2480 --><replaceable>sd</replaceable></title>
2482 <para>Set the security descriptor of the given <emphasis>key</emphasis> from a
2483 Security Descriptor Definition Language (SDDL) string <emphasis>sd</emphasis>.
2488 <title>REGISTRY IMPORT <replaceable>file</replaceable><!--
2489 --><replaceable> [--precheck <check-file>] [opt]</replaceable></title>
2490 <para>Import a registration entries (.reg) <emphasis>file</emphasis>.</para>
2491 <para>The following options are available:</para>
2493 <varlistentry><term>--precheck <replaceable>check-file</replaceable></term>
2495 This is a mechanism to check the existence or non-existence of
2496 certain keys or values specified in a precheck file before applying
2498 The import file will only be applied if the precheck succeeds.
2501 The check-file follows the normal registry file syntax with the
2502 following semantics:
2505 <listitem><para><value name>=<value> checks whether the
2506 value exists and has the given value.</para></listitem>
2507 <listitem><para><value name>=- checks whether the value does
2508 not exist.</para></listitem>
2509 <listitem><para>[key] checks whether the key exists.</para>
2511 <listitem><para>[-key] checks whether the key does not exist.</para>
2520 <title>REGISTRY EXPORT <replaceable>key</replaceable><!--
2521 --><replaceable>file</replaceable><!--
2522 --><replaceable>[opt]</replaceable></title>
2524 <para>Export a <emphasis>key</emphasis> to a registration entries (.reg)
2525 <emphasis>file</emphasis>.
2530 <title>REGISTRY CONVERT <replaceable>in</replaceable> <!--
2531 --><replaceable>out</replaceable> <!--
2532 --><replaceable>[[inopt] outopt]</replaceable></title>
2534 <para>Convert a registration entries (.reg) file <emphasis>in</emphasis>.
2539 <title>REGISTRY CHECK [-ravTl] [-o <ODB>] [--wipe] [<DB>]</title>
2540 <para>Check and repair the registry database. If no option is given a read only check of the database is done. Among others an interactive or automatic repair mode may be chosen with one of the following options
2543 <varlistentry><term>-r|--repair</term>
2545 Interactive repair mode, ask a lot of questions.
2549 <varlistentry><term>-a|--auto</term>
2551 Noninteractive repair mode, use default answers.
2555 <varlistentry><term>-v|--verbose</term>
2557 Produce more output.
2561 <varlistentry><term>-T|--test</term>
2563 Dry run, show what changes would be made but don't touch anything.
2567 <varlistentry><term>-l|--lock</term>
2569 Lock the database while doing the check.
2573 <varlistentry><term>--reg-version={1,2,3}</term>
2575 Specify the format of the registry database. If not given it defaults to
2576 the value of the binary or, if an registry.tdb is explizitly stated at
2577 the commandline, to the value found in the INFO/version record.
2581 <varlistentry><term>[--db] <DB></term>
2583 Check the specified database.
2587 <varlistentry><term>-o|--output <ODB></term>
2589 Create a new registry database <ODB> instead of modifying the
2590 input. If <ODB> is already existing --wipe may be used to
2595 <varlistentry><term>--wipe</term>
2597 Replace the registry database instead of modifying the input or
2598 overwrite an existing output database.
2602 <varlistentry><term></term>
2613 <title>EVENTLOG</title>
2615 <para>Starting with version 3.4.0 net can read, dump, import and export native
2616 win32 eventlog files (usually *.evt). evt files are used by the native Windows eventviewer tools.
2620 The import and export of evt files can only succeed when <parameter>eventlog list</parameter> is used in
2621 <emphasis>smb.conf</emphasis> file.
2622 See the <citerefentry><refentrytitle>smb.conf</refentrytitle> <manvolnum>5</manvolnum></citerefentry> manpage for details.
2625 <para>The eventlog commands are:
2627 <member>net eventlog dump - Dump a eventlog *.evt file on the screen.</member>
2628 <member>net eventlog import - Import a eventlog *.evt into the samba internal
2629 tdb based representation of eventlogs.</member>
2630 <member>net eventlog export - Export the samba internal tdb based representation
2631 of eventlogs into an eventlog *.evt file.</member>
2636 <title>EVENTLOG DUMP <replaceable>filename</replaceable></title>
2639 Prints a eventlog *.evt file to standard output.
2644 <title>EVENTLOG IMPORT <replaceable>filename</replaceable> <replaceable>eventlog</replaceable></title>
2647 Imports a eventlog *.evt file defined by <replaceable>filename</replaceable> into the
2648 samba internal tdb representation of eventlog defined by <replaceable>eventlog</replaceable>.
2649 <replaceable>eventlog</replaceable> needs to part of the <parameter>eventlog list</parameter>
2650 defined in smb.conf.
2651 See the <citerefentry><refentrytitle>smb.conf</refentrytitle> <manvolnum>5</manvolnum></citerefentry> manpage for details.
2657 <title>EVENTLOG EXPORT <replaceable>filename</replaceable> <replaceable>eventlog</replaceable></title>
2660 Exports the samba internal tdb representation of eventlog defined by <replaceable>eventlog</replaceable>
2661 to a eventlog *.evt file defined by <replaceable>filename</replaceable>.
2662 <replaceable>eventlog</replaceable> needs to part of the <parameter>eventlog list</parameter>
2663 defined in smb.conf.
2664 See the <citerefentry><refentrytitle>smb.conf</refentrytitle> <manvolnum>5</manvolnum></citerefentry> manpage for details.
2674 <para>Starting with version 3.2.0 Samba has support for remote join and unjoin APIs, both client and server-side. Windows supports remote join capabilities since Windows 2000.
2676 <para>In order for Samba to be joined or unjoined remotely an account must be used that is either member of the Domain Admins group, a member of the local Administrators group or a user that is granted the SeMachineAccountPrivilege privilege.
2679 <para>The client side support for remote join is implemented in the net dom commands which are:
2681 <member>net dom join - Join a remote computer into a domain.</member>
2682 <member>net dom unjoin - Unjoin a remote computer from a domain.</member>
2683 <member>net dom renamecomputer - Renames a remote computer joined to a domain.</member>
2688 <title>DOM JOIN <replaceable>domain=DOMAIN</replaceable> <replaceable>ou=OU</replaceable> <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
2691 Joins a computer into a domain. This command supports the following additional parameters:
2696 <listitem><para><replaceable>DOMAIN</replaceable> can be a NetBIOS domain name (also known as short domain name) or a DNS domain name for Active Directory Domains. As in Windows, it is also possible to control which Domain Controller to use. This can be achieved by appending the DC name using the \ separator character. Example: MYDOM\MYDC. The <replaceable>DOMAIN</replaceable> parameter cannot be NULL.</para></listitem>
2698 <listitem><para><replaceable>OU</replaceable> can be set to a RFC 1779 LDAP DN, like <emphasis>ou=mymachines,cn=Users,dc=example,dc=com</emphasis> in order to create the machine account in a non-default LDAP container. This optional parameter is only supported when joining Active Directory Domains.</para></listitem>
2700 <listitem><para><replaceable>ACCOUNT</replaceable> defines a domain account that will be used to join the machine to the domain. This domain account needs to have sufficient privileges to join machines.</para></listitem>
2702 <listitem><para><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</para></listitem>
2704 <listitem><para><replaceable>REBOOT</replaceable> is an optional parameter that can be set to reboot the remote machine after successful join to the domain.</para></listitem>
2709 Note that you also need to use standard net parameters to connect and authenticate to the remote machine that you want to join. These additional parameters include: -S computer and -U user.
2713 net dom join -S xp -U XP\\administrator%secret domain=MYDOM account=MYDOM\\administrator password=topsecret reboot.
2716 This example would connect to a computer named XP as the local administrator using password secret, and join the computer into a domain called MYDOM using the MYDOM domain administrator account and password topsecret. After successful join, the computer would reboot.
2722 <title>DOM UNJOIN <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
2725 Unjoins a computer from a domain. This command supports the following additional parameters:
2730 <listitem><para><replaceable>ACCOUNT</replaceable> defines a domain account that will be used to unjoin the machine from the domain. This domain account needs to have sufficient privileges to unjoin machines.</para></listitem>
2732 <listitem><para><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</para></listitem>
2734 <listitem><para><replaceable>REBOOT</replaceable> is an optional parameter that can be set to reboot the remote machine after successful unjoin from the domain.</para></listitem>
2739 Note that you also need to use standard net parameters to connect and authenticate to the remote machine that you want to unjoin. These additional parameters include: -S computer and -U user.
2743 net dom unjoin -S xp -U XP\\administrator%secret account=MYDOM\\administrator password=topsecret reboot.
2746 This example would connect to a computer named XP as the local administrator using password secret, and unjoin the computer from the domain using the MYDOM domain administrator account and password topsecret. After successful unjoin, the computer would reboot.
2752 <title>DOM RENAMECOMPUTER <replaceable>newname=NEWNAME</replaceable> <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
2755 Renames a computer that is joined to a domain. This command supports the following additional parameters:
2760 <listitem><para><replaceable>NEWNAME</replaceable> defines the new name of the machine in the domain.</para></listitem>
2762 <listitem><para><replaceable>ACCOUNT</replaceable> defines a domain account that will be used to rename the machine in the domain. This domain account needs to have sufficient privileges to rename machines.</para></listitem>
2764 <listitem><para><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</para></listitem>
2766 <listitem><para><replaceable>REBOOT</replaceable> is an optional parameter that can be set to reboot the remote machine after successful rename in the domain.</para></listitem>
2771 Note that you also need to use standard net parameters to connect and authenticate to the remote machine that you want to rename in the domain. These additional parameters include: -S computer and -U user.
2775 net dom renamecomputer -S xp -U XP\\administrator%secret newname=XPNEW account=MYDOM\\administrator password=topsecret reboot.
2778 This example would connect to a computer named XP as the local administrator using password secret, and rename the joined computer to XPNEW using the MYDOM domain administrator account and password topsecret. After successful rename, the computer would reboot.
2786 <title>G_LOCK</title>
2788 <para>Manage global locks.</para>
2791 <title>G_LOCK DO <replaceable>lockname</replaceable> <replaceable>timeout</replaceable> <replaceable>command</replaceable></title>
2794 Execute a shell command under a global lock. This might be useful to define the
2795 order in which several shell commands will be executed. The locking information
2796 is stored in a file called <filename>g_lock.tdb</filename>. In setups with CTDB
2797 running, the locking information will be available on all cluster nodes.
2801 <listitem><para><replaceable>LOCKNAME</replaceable> defines the name of the global lock.</para></listitem>
2802 <listitem><para><replaceable>TIMEOUT</replaceable> defines the timeout.</para></listitem>
2803 <listitem><para><replaceable>COMMAND</replaceable> defines the shell command to execute.</para></listitem>
2808 <title>G_LOCK LOCKS</title>
2811 Print a list of all currently existing locknames.
2816 <title>G_LOCK DUMP <replaceable>lockname</replaceable></title>
2819 Dump the locking table of a certain global lock.
2828 <para>Print information from tdb records.</para>
2831 <title>TDB LOCKING <replaceable>key</replaceable> [DUMP]</title>
2833 <para>List sharename, filename and number of share modes
2834 for a record from locking.tdb. With the optional DUMP options,
2835 dump the complete record.</para>
2839 <para><replaceable>KEY</replaceable>
2840 Key of the tdb record as hex string.</para>
2848 <title>HELP [COMMAND]</title>
2850 <para>Gives usage information for the specified command.</para>
2857 <title>VERSION</title>
2859 <para>This man page is complete for version 3 of the Samba
2864 <title>AUTHOR</title>
2866 <para>The original Samba software and related utilities
2867 were created by Andrew Tridgell. Samba is now developed
2868 by the Samba Team as an Open Source project similar
2869 to the way the Linux kernel is developed.</para>
2871 <para>The net manpage was written by Jelmer Vernooij.</para>