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">3.6</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</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>
37 <arg choice="opt">-V</arg>
38 <arg choice="opt">--request-timeout seconds</arg>
43 <title>DESCRIPTION</title>
45 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
46 <manvolnum>7</manvolnum></citerefentry> suite.</para>
48 <para>The Samba net utility is meant to work just like the net utility
49 available for windows and DOS. The first argument should be used
50 to specify the protocol to use when executing a certain command.
51 ADS is used for ActiveDirectory, RAP is using for old (Win9x/NT3)
52 clients and RPC can be used for NT4 and Windows 2000. If this
53 argument is omitted, net will try to determine it automatically.
54 Not all commands are available on all protocols.
60 <title>OPTIONS</title>
66 <term>-w target-workgroup</term>
68 Sets target workgroup or domain. You have to specify
69 either this option or the IP address or the name of a server.
74 <term>-W workgroup</term>
76 Sets client workgroup or domain
88 <term>-I ip-address</term>
90 IP address of target server to use. You have to
91 specify either this option or a target workgroup or
99 Port on the target server to connect to (usually 139 or 445).
100 Defaults to trying 445 first, then 139.
104 &stdarg.netbios.name;
108 <term>-S server</term>
110 Name of target server. You should specify either
111 this option or a target workgroup or a target IP address.
118 When listing data, give more information on each item.
125 Make queries to the external server using the machine account of the local server.
130 <term>--request-timeout 30</term>
132 Let client requests timeout after 30 seconds the default is 10
137 &stdarg.server.debug;
142 <title>COMMANDS</title>
145 <title>CHANGESECRETPW</title>
147 <para>This command allows the Samba machine account password to be set from an external application
148 to a machine account password that has already been stored in Active Directory. DO NOT USE this command
149 unless you know exactly what you are doing. The use of this command requires that the force flag (-f)
150 be used also. There will be NO command prompt. Whatever information is piped into stdin, either by
151 typing at the command line or otherwise, will be stored as the literal machine password. Do NOT use
152 this without care and attention as it will overwrite a legitimate machine password without warning.
153 YOU HAVE BEEN WARNED.
161 <para>The <command>NET TIME</command> command allows you to view the time on a remote server
162 or synchronise the time on the local server with the time on the remote server.</para>
167 <para>Without any options, the <command>NET TIME</command> command
168 displays the time on the remote server.
174 <title>TIME SYSTEM</title>
176 <para>Displays the time on the remote server in a format ready for <command>/bin/date</command>.</para>
181 <title>TIME SET</title>
182 <para>Tries to set the date and time of the local server to that on
183 the remote server using <command>/bin/date</command>. </para>
188 <title>TIME ZONE</title>
190 <para>Displays the timezone in hours from GMT on the remote computer.</para>
196 <title>[RPC|ADS] JOIN [TYPE] [-U username[%password]] [createupn=UPN] [createcomputer=OU] [options]</title>
199 Join a domain. If the account already exists on the server, and
200 [TYPE] is MEMBER, the machine will attempt to join automatically.
201 (Assuming that the machine has been created in server manager)
202 Otherwise, a password will be prompted for, and a new account may
206 [TYPE] may be PDC, BDC or MEMBER to specify the type of server
211 [UPN] (ADS only) set the principalname attribute during the join. The default
212 format is host/netbiosname@REALM.
216 [OU] (ADS only) Precreate the computer account in a specific OU. The
217 OU string reads from top to bottom without RDNs, and is delimited by
218 a '/'. Please note that '\' is used for escape by both the shell
219 and ldap, so it may need to be doubled or quadrupled to pass through,
220 and it is not used as a delimiter.
225 <title>[RPC] OLDJOIN [options]</title>
227 <para>Join a domain. Use the OLDJOIN option to join the domain
228 using the old style of domain joining - you need to create a trust
229 account in server manager first.</para>
233 <title>[RPC|ADS] USER</title>
236 <title>[RPC|ADS] USER</title>
238 <para>List all users</para>
243 <title>[RPC|ADS] USER DELETE <replaceable>target</replaceable></title>
245 <para>Delete specified user</para>
250 <title>[RPC|ADS] USER INFO <replaceable>target</replaceable></title>
252 <para>List the domain groups of the specified user.</para>
257 <title>[RPC|ADS] USER RENAME <replaceable>oldname</replaceable> <replaceable>newname</replaceable></title>
259 <para>Rename specified user.</para>
264 <title>[RPC|ADS] USER ADD <replaceable>name</replaceable> [password] [-F user flags] [-C comment]</title>
266 <para>Add specified user.</para>
271 <title>[RPC|ADS] GROUP</title>
274 <title>[RPC|ADS] GROUP [misc options] [targets]</title>
275 <para>List user groups.</para>
279 <title>[RPC|ADS] GROUP DELETE <replaceable>name</replaceable> [misc. options]</title>
281 <para>Delete specified group.</para>
286 <title>[RPC|ADS] GROUP ADD <replaceable>name</replaceable> [-C comment]</title>
288 <para>Create specified group.</para>
294 <title>[RAP|RPC] SHARE</title>
297 <title>[RAP|RPC] SHARE [misc. options] [targets]</title>
299 <para>Enumerates all exported resources (network shares) on target server.</para>
304 <title>[RAP|RPC] SHARE ADD <replaceable>name=serverpath</replaceable> [-C comment] [-M maxusers] [targets]</title>
306 <para>Adds a share from a server (makes the export active). Maxusers
307 specifies the number of users that can be connected to the
308 share simultaneously.</para>
313 <title>SHARE DELETE <replaceable>sharename</replaceable></title>
315 <para>Delete specified share.</para>
320 <title>[RPC|RAP] FILE</title>
323 <title>[RPC|RAP] FILE</title>
325 <para>List all open files on remote server.</para>
330 <title>[RPC|RAP] FILE CLOSE <replaceable>fileid</replaceable></title>
332 <para>Close file with specified <replaceable>fileid</replaceable> on
333 remote server.</para>
338 <title>[RPC|RAP] FILE INFO <replaceable>fileid</replaceable></title>
341 Print information on specified <replaceable>fileid</replaceable>.
342 Currently listed are: file-id, username, locks, path, permissions.
348 <title>[RAP|RPC] FILE USER <replaceable>user</replaceable></title>
351 List files opened by specified <replaceable>user</replaceable>.
352 Please note that <command>net rap file user</command> does not work
353 against Samba servers.
361 <title>SESSION</title>
364 <title>RAP SESSION</title>
366 <para>Without any other options, SESSION enumerates all active SMB/CIFS
367 sessions on the target server.</para>
372 <title>RAP SESSION DELETE|CLOSE <replaceable>CLIENT_NAME</replaceable></title>
374 <para>Close the specified sessions.</para>
379 <title>RAP SESSION INFO <replaceable>CLIENT_NAME</replaceable></title>
381 <para>Give a list with all the open files in specified session.</para>
388 <title>RAP SERVER <replaceable>DOMAIN</replaceable></title>
390 <para>List all servers in specified domain or workgroup. Defaults
391 to local domain.</para>
396 <title>RAP DOMAIN</title>
398 <para>Lists all domains and workgroups visible on the
399 current network.</para>
404 <title>RAP PRINTQ</title>
407 <title>RAP PRINTQ INFO <replaceable>QUEUE_NAME</replaceable></title>
409 <para>Lists the specified print queue and print jobs on the server.
410 If the <replaceable>QUEUE_NAME</replaceable> is omitted, all
411 queues are listed.</para>
416 <title>RAP PRINTQ DELETE <replaceable>JOBID</replaceable></title>
418 <para>Delete job with specified id.</para>
425 <title>RAP VALIDATE <replaceable>user</replaceable> [<replaceable>password</replaceable>]</title>
428 Validate whether the specified user can log in to the
429 remote server. If the password is not specified on the commandline, it
438 <title>RAP GROUPMEMBER</title>
441 <title>RAP GROUPMEMBER LIST <replaceable>GROUP</replaceable></title>
443 <para>List all members of the specified group.</para>
448 <title>RAP GROUPMEMBER DELETE <replaceable>GROUP</replaceable> <replaceable>USER</replaceable></title>
450 <para>Delete member from group.</para>
455 <title>RAP GROUPMEMBER ADD <replaceable>GROUP</replaceable> <replaceable>USER</replaceable></title>
457 <para>Add member to group.</para>
464 <title>RAP ADMIN <replaceable>command</replaceable></title>
466 <para>Execute the specified <replaceable>command</replaceable> on
467 the remote server. Only works with OS/2 servers.
475 <title>RAP SERVICE</title>
478 <title>RAP SERVICE START <replaceable>NAME</replaceable> [arguments...]</title>
480 <para>Start the specified service on the remote server. Not implemented yet.</para>
487 <title>RAP SERVICE STOP</title>
489 <para>Stop the specified service on the remote server.</para>
498 <title>RAP PASSWORD <replaceable>USER</replaceable> <replaceable>OLDPASS</replaceable> <replaceable>NEWPASS</replaceable></title>
501 Change password of <replaceable>USER</replaceable> from <replaceable>OLDPASS</replaceable> to <replaceable>NEWPASS</replaceable>.
507 <title>LOOKUP</title>
510 <title>LOOKUP HOST <replaceable>HOSTNAME</replaceable> [<replaceable>TYPE</replaceable>]</title>
513 Lookup the IP address of the given host with the specified type (netbios suffix).
514 The type defaults to 0x20 (workstation).
520 <title>LOOKUP LDAP [<replaceable>DOMAIN</replaceable>]</title>
522 <para>Give IP address of LDAP server of specified <replaceable>DOMAIN</replaceable>. Defaults to local domain.</para>
527 <title>LOOKUP KDC [<replaceable>REALM</replaceable>]</title>
529 <para>Give IP address of KDC for the specified <replaceable>REALM</replaceable>.
530 Defaults to local realm.</para>
535 <title>LOOKUP DC [<replaceable>DOMAIN</replaceable>]</title>
537 <para>Give IP's of Domain Controllers for specified <replaceable>
538 DOMAIN</replaceable>. Defaults to local domain.</para>
543 <title>LOOKUP MASTER <replaceable>DOMAIN</replaceable></title>
545 <para>Give IP of master browser for specified <replaceable>DOMAIN</replaceable>
546 or workgroup. Defaults to local domain.</para>
555 <para>Samba uses a general caching interface called 'gencache'. It
556 can be controlled using 'NET CACHE'.</para>
558 <para>All the timeout parameters support the suffixes:
561 <member>s - Seconds</member>
562 <member>m - Minutes</member>
563 <member>h - Hours</member>
564 <member>d - Days</member>
565 <member>w - Weeks</member>
571 <title>CACHE ADD <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable></title>
573 <para>Add specified key+data to the cache with the given timeout.</para>
578 <title>CACHE DEL <replaceable>key</replaceable></title>
580 <para>Delete key from the cache.</para>
585 <title>CACHE SET <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable></title>
587 <para>Update data of existing cache entry.</para>
592 <title>CACHE SEARCH <replaceable>PATTERN</replaceable></title>
594 <para>Search for the specified pattern in the cache data.</para>
599 <title>CACHE LIST</title>
602 List all current items in the cache.
608 <title>CACHE FLUSH</title>
610 <para>Remove all the current items from the cache.</para>
617 <title>GETLOCALSID [DOMAIN]</title>
619 <para>Prints the SID of the specified domain, or if the parameter is
620 omitted, the SID of the local server.</para>
625 <title>SETLOCALSID S-1-5-21-x-y-z</title>
627 <para>Sets SID for the local server to the specified SID.</para>
632 <title>GETDOMAINSID</title>
634 <para>Prints the local machine SID and the SID of the current
640 <title>SETDOMAINSID</title>
642 <para>Sets the SID of the current domain.</para>
647 <title>GROUPMAP</title>
649 <para>Manage the mappings between Windows group SIDs and UNIX groups.
650 Common options include:</para>
653 <listitem><para>unixgroup - Name of the UNIX group</para></listitem>
654 <listitem><para>ntgroup - Name of the Windows NT group (must be
655 resolvable to a SID</para></listitem>
656 <listitem><para>rid - Unsigned 32-bit integer</para></listitem>
657 <listitem><para>sid - Full SID in the form of "S-1-..."</para></listitem>
658 <listitem><para>type - Type of the group; either 'domain', 'local',
659 or 'builtin'</para></listitem>
660 <listitem><para>comment - Freeform text description of the group</para></listitem>
664 <title>GROUPMAP ADD</title>
667 Add a new group mapping entry:
669 net groupmap add {rid=int|sid=string} unixgroup=string \
670 [type={domain|local}] [ntgroup=string] [comment=string]
677 <title>GROUPMAP DELETE</title>
679 <para>Delete a group mapping entry. If more than one group name matches, the first entry found is deleted.</para>
681 <para>net groupmap delete {ntgroup=string|sid=SID}</para>
686 <title>GROUPMAP MODIFY</title>
688 <para>Update en existing group entry.</para>
692 net groupmap modify {ntgroup=string|sid=SID} [unixgroup=string] \
693 [comment=string] [type={domain|local}]
699 <title>GROUPMAP LIST</title>
701 <para>List existing group mapping entries.</para>
703 <para>net groupmap list [verbose] [ntgroup=string] [sid=SID]</para>
711 <title>MAXRID</title>
713 <para>Prints out the highest RID currently in use on the local
714 server (by the active 'passdb backend').
720 <title>RPC INFO</title>
722 <para>Print information about the domain of the remote server,
723 such as domain name, domain sid and number of users and groups.
729 <title>[RPC|ADS] TESTJOIN</title>
731 <para>Check whether participation in a domain is still valid.</para>
736 <title>[RPC|ADS] CHANGETRUSTPW</title>
738 <para>Force change of domain trust password.</para>
743 <title>RPC TRUSTDOM</title>
746 <title>RPC TRUSTDOM ADD <replaceable>DOMAIN</replaceable></title>
748 <para>Add a interdomain trust account for <replaceable>DOMAIN</replaceable>.
749 This is in fact a Samba account named <replaceable>DOMAIN$</replaceable>
750 with the account flag <constant>'I'</constant> (interdomain trust account).
751 This is required for incoming trusts to work. It makes Samba be a
752 trusted domain of the foreign (trusting) domain.
753 Users of the Samba domain will be made available in the foreign domain.
754 If the command is used against localhost it has the same effect as
755 <command>smbpasswd -a -i DOMAIN</command>. Please note that both commands
756 expect a appropriate UNIX account.
762 <title>RPC TRUSTDOM DEL <replaceable>DOMAIN</replaceable></title>
764 <para>Remove interdomain trust account for
765 <replaceable>DOMAIN</replaceable>. If it is used against localhost
766 it has the same effect as <command>smbpasswd -x DOMAIN$</command>.
772 <title>RPC TRUSTDOM ESTABLISH <replaceable>DOMAIN</replaceable></title>
775 Establish a trust relationship to a trusted domain.
776 Interdomain account must already be created on the remote PDC.
777 This is required for outgoing trusts to work. It makes Samba be a
778 trusting domain of a foreign (trusted) domain.
779 Users of the foreign domain will be made available in our domain.
780 You'll need winbind and a working idmap config to make them
781 appear in your system.
787 <title>RPC TRUSTDOM REVOKE <replaceable>DOMAIN</replaceable></title>
788 <para>Abandon relationship to trusted domain</para>
793 <title>RPC TRUSTDOM LIST</title>
795 <para>List all interdomain trust relationships.</para>
800 <title>RPC RIGHTS</title>
802 <para>This subcommand is used to view and manage Samba's rights assignments (also
803 referred to as privileges). There are three options currently available:
804 <parameter>list</parameter>, <parameter>grant</parameter>, and
805 <parameter>revoke</parameter>. More details on Samba's privilege model and its use
806 can be found in the Samba-HOWTO-Collection.</para>
814 <title>RPC ABORTSHUTDOWN</title>
816 <para>Abort the shutdown of a remote server.</para>
821 <title>RPC SHUTDOWN [-t timeout] [-r] [-f] [-C message]</title>
823 <para>Shut down the remote server.</para>
829 Reboot after shutdown.
836 Force shutting down all applications.
841 <term>-t timeout</term>
843 Timeout before system will be shut down. An interactive
844 user of the system can use this time to cancel the shutdown.
849 <term>-C message</term>
850 <listitem><para>Display the specified message on the screen to
851 announce the shutdown.</para></listitem>
858 <title>RPC SAMDUMP</title>
860 <para>Print out sam database of remote server. You need
861 to run this against the PDC, from a Samba machine joined as a BDC. </para>
865 <title>RPC VAMPIRE</title>
867 <para>Export users, aliases and groups from remote server to
868 local server. You need to run this against the PDC, from a Samba machine joined as a BDC.
873 <title>RPC VAMPIRE KEYTAB</title>
875 <para>Dump remote SAM database to local Kerberos keytab file.
880 <title>RPC VAMPIRE LDIF</title>
882 <para>Dump remote SAM database to local LDIF file or standard output.
887 <title>RPC GETSID</title>
889 <para>Fetch domain SID and store it in the local <filename>secrets.tdb</filename>. </para>
894 <title>ADS LEAVE</title>
896 <para>Make the remote host leave the domain it is part of. </para>
901 <title>ADS STATUS</title>
903 <para>Print out status of machine account of the local machine in ADS.
904 Prints out quite some debug info. Aimed at developers, regular
905 users should use <command>NET ADS TESTJOIN</command>.</para>
910 <title>ADS PRINTER</title>
913 <title>ADS PRINTER INFO [<replaceable>PRINTER</replaceable>] [<replaceable>SERVER</replaceable>]</title>
916 Lookup info for <replaceable>PRINTER</replaceable> on <replaceable>SERVER</replaceable>. The printer name defaults to "*", the
917 server name defaults to the local host.</para>
922 <title>ADS PRINTER PUBLISH <replaceable>PRINTER</replaceable></title>
924 <para>Publish specified printer using ADS.</para>
929 <title>ADS PRINTER REMOVE <replaceable>PRINTER</replaceable></title>
931 <para>Remove specified printer from ADS directory.</para>
938 <title>ADS SEARCH <replaceable>EXPRESSION</replaceable> <replaceable>ATTRIBUTES...</replaceable></title>
940 <para>Perform a raw LDAP search on a ADS server and dump the results. The
941 expression is a standard LDAP search expression, and the
942 attributes are a list of LDAP fields to show in the results.</para>
944 <para>Example: <userinput>net ads search '(objectCategory=group)' sAMAccountName</userinput>
950 <title>ADS DN <replaceable>DN</replaceable> <replaceable>(attributes)</replaceable></title>
953 Perform a raw LDAP search on a ADS server and dump the results. The
954 DN standard LDAP DN, and the attributes are a list of LDAP fields
955 to show in the result.
958 <para>Example: <userinput>net ads dn 'CN=administrator,CN=Users,DC=my,DC=domain' SAMAccountName</userinput></para>
963 <title>ADS WORKGROUP</title>
965 <para>Print out workgroup name for specified kerberos realm.</para>
970 <title>SAM CREATEBUILTINGROUP <NAME></title>
973 (Re)Create a BUILTIN group.
974 Only a wellknown set of BUILTIN groups can be created with this command.
975 This is the list of currently recognized group names: Administrators,
976 Users, Guests, Power Users, Account Operators, Server Operators, Print
977 Operators, Backup Operators, Replicator, RAS Servers, Pre-Windows 2000
980 This command requires a running Winbindd with idmap allocation properly
981 configured. The group gid will be allocated out of the winbindd range.
987 <title>SAM CREATELOCALGROUP <NAME></title>
990 Create a LOCAL group (also known as Alias).
992 This command requires a running Winbindd with idmap allocation properly
993 configured. The group gid will be allocated out of the winbindd range.
999 <title>SAM DELETELOCALGROUP <NAME></title>
1002 Delete an existing LOCAL group (also known as Alias).
1009 <title>SAM MAPUNIXGROUP <NAME></title>
1012 Map an existing Unix group and make it a Domain Group, the domain group
1013 will have the same name.
1019 <title>SAM UNMAPUNIXGROUP <NAME></title>
1022 Remove an existing group mapping entry.
1028 <title>SAM ADDMEM <GROUP> <MEMBER></title>
1031 Add a member to a Local group. The group can be specified only by name,
1032 the member can be specified by name or SID.
1038 <title>SAM DELMEM <GROUP> <MEMBER></title>
1041 Remove a member from a Local group. The group and the member must be
1048 <title>SAM LISTMEM <GROUP></title>
1051 List Local group members. The group must be specified by name.
1057 <title>SAM LIST <users|groups|localgroups|builtin|workstations> [verbose]</title>
1060 List the specified set of accounts by name. If verbose is specified,
1061 the rid and description is also provided for each account.
1067 <title>SAM RIGHTS LIST</title>
1070 List all available privileges.
1076 <title>SAM RIGHTS GRANT <NAME> <PRIVILEGE></title>
1079 Grant one or more privileges to a user.
1085 <title>SAM RIGHTS REVOKE <NAME> <PRIVILEGE></title>
1088 Revoke one or more privileges from a user.
1094 <title>SAM SHOW <NAME></title>
1097 Show the full DOMAIN\\NAME the SID and the type for the corresponding
1104 <title>SAM SET HOMEDIR <NAME> <DIRECTORY></title>
1107 Set the home directory for a user account.
1113 <title>SAM SET PROFILEPATH <NAME> <PATH></title>
1116 Set the profile path for a user account.
1122 <title>SAM SET COMMENT <NAME> <COMMENT></title>
1125 Set the comment for a user or group account.
1131 <title>SAM SET FULLNAME <NAME> <FULL NAME></title>
1134 Set the full name for a user account.
1140 <title>SAM SET LOGONSCRIPT <NAME> <SCRIPT></title>
1143 Set the logon script for a user account.
1149 <title>SAM SET HOMEDRIVE <NAME> <DRIVE></title>
1152 Set the home drive for a user account.
1158 <title>SAM SET WORKSTATIONS <NAME> <WORKSTATIONS></title>
1161 Set the workstations a user account is allowed to log in from.
1167 <title>SAM SET DISABLE <NAME></title>
1170 Set the "disabled" flag for a user account.
1176 <title>SAM SET PWNOTREQ <NAME></title>
1179 Set the "password not required" flag for a user account.
1185 <title>SAM SET AUTOLOCK <NAME></title>
1188 Set the "autolock" flag for a user account.
1194 <title>SAM SET PWNOEXP <NAME></title>
1197 Set the "password do not expire" flag for a user account.
1203 <title>SAM SET PWDMUSTCHANGENOW <NAME> [yes|no]</title>
1206 Set or unset the "password must change" flag for a user account.
1212 <title>SAM POLICY LIST</title>
1215 List the available account policies.
1221 <title>SAM POLICY SHOW <account policy></title>
1224 Show the account policy value.
1230 <title>SAM POLICY SET <account policy> <value></title>
1233 Set a value for the account policy.
1234 Valid values can be: "forever", "never", "off", or a number.
1240 <title>SAM PROVISION</title>
1243 Only available if ldapsam:editposix is set and winbindd is running.
1244 Properly populates the ldap tree with the basic accounts (Administrator)
1245 and groups (Domain Users, Domain Admins, Domain Guests) on the ldap tree.
1251 <title>IDMAP DUMP <local tdb file name></title>
1254 Dumps the mappings contained in the local tdb file specified.
1255 This command is useful to dump only the mappings produced by the idmap_tdb backend.
1261 <title>IDMAP RESTORE [input file]</title>
1264 Restore the mappings from the specified file or stdin.
1270 <title>IDMAP SECRET <DOMAIN> <secret></title>
1273 Store a secret for the specified domain, used primarily for domains
1274 that use idmap_ldap as a backend. In this case the secret is used
1275 as the password for the user DN used to bind to the ldap server.
1281 <title>USERSHARE</title>
1283 <para>Starting with version 3.0.23, a Samba server now supports the ability for
1284 non-root users to add user defined shares to be exported using the "net usershare"
1289 To set this up, first set up your smb.conf by adding to the [global] section:
1291 usershare path = /usr/local/samba/lib/usershares
1293 Next create the directory /usr/local/samba/lib/usershares, change the owner to root and
1294 set the group owner to the UNIX group who should have the ability to create usershares,
1295 for example a group called "serverops".
1297 Set the permissions on /usr/local/samba/lib/usershares to 01770.
1299 (Owner and group all access, no access for others, plus the sticky bit,
1300 which means that a file in that directory can be renamed or deleted only
1301 by the owner of the file).
1303 Finally, tell smbd how many usershares you will allow by adding to the [global]
1304 section of smb.conf a line such as :
1306 usershare max shares = 100.
1308 To allow 100 usershare definitions. Now, members of the UNIX group "serverops"
1309 can create user defined shares on demand using the commands below.
1312 <para>The usershare commands are:
1315 <member>net usershare add sharename path [comment [acl] [guest_ok=[y|n]]] - to add or change a user defined share.</member>
1316 <member>net usershare delete sharename - to delete a user defined share.</member>
1317 <member>net usershare info [-l|--long] [wildcard sharename] - to print info about a user defined share.</member>
1318 <member>net usershare list [-l|--long] [wildcard sharename] - to list user defined shares.</member>
1324 <title>USERSHARE ADD <replaceable>sharename</replaceable> <replaceable>path</replaceable> <replaceable>[comment]</replaceable> <replaceable>[acl]</replaceable> <replaceable>[guest_ok=[y|n]]</replaceable></title>
1327 Add or replace a new user defined share, with name "sharename".
1331 "path" specifies the absolute pathname on the system to be exported.
1332 Restrictions may be put on this, see the global smb.conf parameters:
1333 "usershare owner only", "usershare prefix allow list", and
1334 "usershare prefix deny list".
1338 The optional "comment" parameter is the comment that will appear
1339 on the share when browsed to by a client.
1342 <para>The optional "acl" field
1343 specifies which users have read and write access to the entire share.
1344 Note that guest connections are not allowed unless the smb.conf parameter
1345 "usershare allow guests" has been set. The definition of a user
1346 defined share acl is: "user:permission", where user is a valid
1347 username on the system and permission can be "F", "R", or "D".
1348 "F" stands for "full permissions", ie. read and write permissions.
1349 "D" stands for "deny" for a user, ie. prevent this user from accessing
1351 "R" stands for "read only", ie. only allow read access to this
1352 share (no creation of new files or directories or writing to files).
1356 The default if no "acl" is given is "Everyone:R", which means any
1357 authenticated user has read-only access.
1361 The optional "guest_ok" has the same effect as the parameter of the
1362 same name in smb.conf, in that it allows guest access to this user
1363 defined share. This parameter is only allowed if the global parameter
1364 "usershare allow guests" has been set to true in the smb.conf.
1367 There is no separate command to modify an existing user defined share,
1368 just use the "net usershare add [sharename]" command using the same
1369 sharename as the one you wish to modify and specify the new options
1370 you wish. The Samba smbd daemon notices user defined share modifications
1371 at connect time so will see the change immediately, there is no need
1372 to restart smbd on adding, deleting or changing a user defined share.
1376 <title>USERSHARE DELETE <replaceable>sharename</replaceable></title>
1379 Deletes the user defined share by name. The Samba smbd daemon
1380 immediately notices this change, although it will not disconnect
1381 any users currently connected to the deleted share.
1387 <title>USERSHARE INFO <replaceable>[-l|--long]</replaceable> <replaceable>[wildcard sharename]</replaceable></title>
1390 Get info on user defined shares owned by the current user matching the given pattern, or all users.
1394 net usershare info on its own dumps out info on the user defined shares that were
1395 created by the current user, or restricts them to share names that match the given
1396 wildcard pattern ('*' matches one or more characters, '?' matches only one character).
1397 If the '-l' or '--long' option is also given, it prints out info on user defined
1398 shares created by other users.
1402 The information given about a share looks like:
1407 usershare_acl=Everyone:F
1410 And is a list of the current settings of the user defined share that can be
1411 modified by the "net usershare add" command.
1417 <title>USERSHARE LIST <replaceable>[-l|--long]</replaceable> <replaceable>wildcard sharename</replaceable></title>
1420 List all the user defined shares owned by the current user matching the given pattern, or all users.
1424 net usershare list on its own list out the names of the user defined shares that were
1425 created by the current user, or restricts the list to share names that match the given
1426 wildcard pattern ('*' matches one or more characters, '?' matches only one character).
1427 If the '-l' or '--long' option is also given, it includes the names of user defined
1428 shares created by other users.
1438 <para>Starting with version 3.2.0, a Samba server can be configured by data
1439 stored in registry. This configuration data can be edited with the new "net
1444 The deployment of this configuration data can be activated in two levels from the
1445 <emphasis>smb.conf</emphasis> file: Share definitions from registry are
1446 activated by setting <parameter>registry shares</parameter> to
1447 <quote>yes</quote> in the [global] section and global configuration options are
1448 activated by setting <smbconfoption name="include">registry</smbconfoption> in
1449 the [global] section for a mixed configuration or by setting
1450 <smbconfoption name="config backend">registry</smbconfoption> in the [global]
1451 section for a registry-only configuration.
1452 See the <citerefentry><refentrytitle>smb.conf</refentrytitle>
1453 <manvolnum>5</manvolnum></citerefentry> manpage for details.
1456 <para>The conf commands are:
1458 <member>net conf list - Dump the complete configuration in smb.conf like
1460 <member>net conf import - Import configuration from file in smb.conf
1462 <member>net conf listshares - List the registry shares.</member>
1463 <member>net conf drop - Delete the complete configuration from
1465 <member>net conf showshare - Show the definition of a registry share.</member>
1466 <member>net conf addshare - Create a new registry share.</member>
1467 <member>net conf delshare - Delete a registry share.</member>
1468 <member>net conf setparm - Store a parameter.</member>
1469 <member>net conf getparm - Retrieve the value of a parameter.</member>
1470 <member>net conf delparm - Delete a parameter.</member>
1471 <member>net conf getincludes - Show the includes of a share definition.</member>
1472 <member>net conf setincludes - Set includes for a share.</member>
1473 <member>net conf delincludes - Delete includes from a share definition.</member>
1478 <title>CONF LIST</title>
1481 Print the configuration data stored in the registry in a smb.conf-like format to
1487 <title>CONF IMPORT <replaceable>[--test|-T]</replaceable> <replaceable>filename</replaceable> <replaceable>[section]</replaceable></title>
1490 This command imports configuration from a file in smb.conf format.
1491 If a section encountered in the input file is present in registry,
1492 its contents is replaced. Sections of registry configuration that have
1493 no counterpart in the input file are not affected. If you want to delete these,
1494 you will have to use the "net conf drop" or "net conf delshare" commands.
1495 Optionally, a section may be specified to restrict the effect of the
1496 import command to that specific section. A test mode is enabled by specifying
1497 the parameter "-T" on the commandline. In test mode, no changes are made to the
1498 registry, and the resulting configuration is printed to standard output instead.
1503 <title>CONF LISTSHARES</title>
1506 List the names of the shares defined in registry.
1511 <title>CONF DROP</title>
1514 Delete the complete configuration data from registry.
1519 <title>CONF SHOWSHARE <replaceable>sharename</replaceable></title>
1522 Show the definition of the share or section specified. It is valid to specify
1523 "global" as sharename to retrieve the global configuration options from
1529 <title>CONF ADDSHARE <replaceable>sharename</replaceable> <replaceable>path</replaceable> [<replaceable>writeable={y|N}</replaceable> [<replaceable>guest_ok={y|N}</replaceable> [<replaceable>comment</replaceable>]]] </title>
1531 <para>Create a new share definition in registry.
1532 The sharename and path have to be given. The share name may
1533 <emphasis>not</emphasis> be "global". Optionally, values for the very
1534 common options "writeable", "guest ok" and a "comment" may be specified.
1535 The same result may be obtained by a sequence of "net conf setparm"
1541 <title>CONF DELSHARE <replaceable>sharename</replaceable></title>
1544 Delete a share definition from registry.
1549 <title>CONF SETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable> <replaceable>value</replaceable></title>
1552 Store a parameter in registry. The section may be global or a sharename.
1553 The section is created if it does not exist yet.
1558 <title>CONF GETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
1561 Show a parameter stored in registry.
1566 <title>CONF DELPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
1569 Delete a parameter stored in registry.
1574 <title>CONF GETINCLUDES <replaceable>section</replaceable></title>
1577 Get the list of includes for the provided section (global or share).
1581 Note that due to the nature of the registry database and the nature of include directives,
1582 the includes need special treatment: Parameters are stored in registry by the parameter
1583 name as valuename, so there is only ever one instance of a parameter per share.
1584 Also, a specific order like in a text file is not guaranteed. For all real
1585 parameters, this is perfectly ok, but the include directive is rather a meta
1586 parameter, for which, in the smb.conf text file, the place where it is specified
1587 between the other parameters is very important. This can not be achieved by the
1588 simple registry smbconf data model, so there is one ordered list of includes
1589 per share, and this list is evaluated after all the parameters of the share.
1593 Further note that currently, only files can be included from registry
1594 configuration. In the future, there will be the ability to include configuration
1595 data from other registry keys.
1600 <title>CONF SETINCLUDES <replaceable>section</replaceable> [<replaceable>filename</replaceable>]+</title>
1603 Set the list of includes for the provided section (global or share) to the given
1604 list of one or more filenames. The filenames may contain the usual smb.conf
1610 <title>CONF DELINCLUDES <replaceable>section</replaceable></title>
1613 Delete the list of includes from the provided section (global or share).
1620 <title>REGISTRY</title>
1622 Manipulate Samba's registry.
1625 <para>The registry commands are:
1627 <member>net registry enumerate - Enumerate registry keys and values.</member>
1628 <member>net registry createkey - Create a new registry key.</member>
1629 <member>net registry deletekey - Delete a registry key.</member>
1630 <member>net registry getvalue - Print a registry value.</member>
1631 <member>net registry getvalueraw - Print a registry value (raw format).</member>
1632 <member>net registry setvalue - Set a new registry value.</member>
1633 <member>net registry increment - Increment a DWORD registry value under a lock.
1635 <member>net registry deletevalue - Delete a registry value.</member>
1636 <member>net registry getsd - Get security descriptor.</member>
1637 <member>net registry getsd_sdd1 - Get security descriptor in sddl format.
1639 <member>net registry setsd_sdd1 - Set security descriptor from sddl format
1641 <member>net registry import - Import a registration entries (.reg) file.
1647 <title>REGISTRY ENUMERATE <replaceable>key</replaceable> </title>
1648 <para>Enumerate subkeys and values of <emphasis>key</emphasis>
1653 <title>REGISTRY CREATEKEY <replaceable>key</replaceable> </title>
1654 <para>Create a new <emphasis>key</emphasis> if not yet existing.
1659 <title>REGISTRY DELETEKEY <replaceable>key</replaceable> </title>
1660 <para>Delete the given <emphasis>key</emphasis> and all of its
1661 subkeys and values from the registry.
1666 <title>REGISTRY GETVALUE <replaceable>key</replaceable> <!--
1667 --><replaceable>name</replaceable></title>
1669 <para>Output type and actual value of the value <emphasis>name</emphasis>
1670 of the given <emphasis>key</emphasis>.
1675 <title>REGISTRY GETVALUERAW <replaceable>key</replaceable> <!--
1676 --><replaceable>name</replaceable></title>
1677 <para>Output the actual value of the value <emphasis>name</emphasis>
1678 of the given <emphasis>key</emphasis>.
1683 <title>REGISTRY SETVALUE <replaceable>key</replaceable> <!--
1684 --><replaceable>name</replaceable> <replaceable>type</replaceable> <!--
1685 --><replaceable>value</replaceable> ...<!--
1688 <para>Set the value <emphasis>name</emphasis>
1689 of an existing <emphasis>key</emphasis>.
1690 <emphasis>type</emphasis> may be one of
1691 <emphasis>sz</emphasis>, <emphasis>multi_sz</emphasis> or
1692 <emphasis>dword</emphasis>.
1693 In case of <emphasis>multi_sz</emphasis> <replaceable>value</replaceable> may
1694 be given multiple times.
1699 <title>REGISTRY INCREMENT <replaceable>key</replaceable> <!--
1700 --><replaceable>name</replaceable> <replaceable>[inc]</replaceable><!--
1703 <para>Increment the DWORD value <emphasis>name</emphasis>
1704 of <emphasis>key</emphasis> by <replaceable>inc</replaceable>
1705 while holding a g_lock.
1706 <emphasis>inc</emphasis> defaults to 1.
1711 <title>REGISTRY DELETEVALUE <replaceable>key</replaceable> <!--
1712 --><replaceable>name</replaceable></title>
1714 <para>Delete the value <emphasis>name</emphasis>
1715 of the given <emphasis>key</emphasis>.
1720 <title>REGISTRY GETSD <replaceable>key</replaceable></title>
1722 <para>Get the security descriptor of the given <emphasis>key</emphasis>.
1727 <title>REGISTRY GETSD_SDDL <replaceable>key</replaceable></title>
1729 <para>Get the security descriptor of the given <emphasis>key</emphasis> as a
1730 Security Descriptor Definition Language (SDDL) string.
1735 <title>REGISTRY SETSD_SDDL <replaceable>key</replaceable><!--
1736 --><replaceable>sd</replaceable></title>
1738 <para>Set the security descriptor of the given <emphasis>key</emphasis> from a
1739 Security Descriptor Definition Language (SDDL) string <emphasis>sd</emphasis>.
1744 <title>REGISTRY IMPORT <replaceable>file</replaceable><!--
1745 --><replaceable>[opt]</replaceable></title>
1747 <para>Import a registration entries (.reg) <emphasis>file</emphasis>.
1754 <title>EVENTLOG</title>
1756 <para>Starting with version 3.4.0 net can read, dump, import and export native
1757 win32 eventlog files (usually *.evt). evt files are used by the native Windows eventviewer tools.
1761 The import and export of evt files can only succeed when <parameter>eventlog list</parameter> is used in
1762 <emphasis>smb.conf</emphasis> file.
1763 See the <citerefentry><refentrytitle>smb.conf</refentrytitle> <manvolnum>5</manvolnum></citerefentry> manpage for details.
1766 <para>The eventlog commands are:
1768 <member>net eventlog dump - Dump a eventlog *.evt file on the screen.</member>
1769 <member>net eventlog import - Import a eventlog *.evt into the samba internal
1770 tdb based representation of eventlogs.</member>
1771 <member>net eventlog export - Export the samba internal tdb based representation
1772 of eventlogs into an eventlog *.evt file.</member>
1777 <title>EVENTLOG DUMP <replaceable>filename</replaceable></title>
1780 Prints a eventlog *.evt file to standard output.
1785 <title>EVENTLOG IMPORT <replaceable>filename</replaceable> <replaceable>eventlog</replaceable></title>
1788 Imports a eventlog *.evt file defined by <replaceable>filename</replaceable> into the
1789 samba internal tdb representation of eventlog defined by <replaceable>eventlog</replaceable>.
1790 <replaceable>eventlog</replaceable> needs to part of the <parameter>eventlog list</parameter>
1791 defined in smb.conf.
1792 See the <citerefentry><refentrytitle>smb.conf</refentrytitle> <manvolnum>5</manvolnum></citerefentry> manpage for details.
1798 <title>EVENTLOG EXPORT <replaceable>filename</replaceable> <replaceable>eventlog</replaceable></title>
1801 Exports the samba internal tdb representation of eventlog defined by <replaceable>eventlog</replaceable>
1802 to a eventlog *.evt file defined by <replaceable>filename</replaceable>.
1803 <replaceable>eventlog</replaceable> needs to part of the <parameter>eventlog list</parameter>
1804 defined in smb.conf.
1805 See the <citerefentry><refentrytitle>smb.conf</refentrytitle> <manvolnum>5</manvolnum></citerefentry> manpage for details.
1815 <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.
1817 <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.
1820 <para>The client side support for remote join is implemented in the net dom commands which are:
1822 <member>net dom join - Join a remote computer into a domain.</member>
1823 <member>net dom unjoin - Unjoin a remote computer from a domain.</member>
1824 <member>net dom renamecomputer - Renames a remote computer joined to a domain.</member>
1829 <title>DOM JOIN <replaceable>domain=DOMAIN</replaceable> <replaceable>ou=OU</replaceable> <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
1832 Joins a computer into a domain. This command supports the following additional parameters:
1837 <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>
1839 <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 containter. This optional parameter is only supported when joining Active Directory Domains.</para></listitem>
1841 <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>
1843 <listitem><para><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</para></listitem>
1845 <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>
1850 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.
1854 net dom join -S xp -U XP\\administrator%secret domain=MYDOM account=MYDOM\\administrator password=topsecret reboot.
1857 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.
1863 <title>DOM UNJOIN <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
1866 Unjoins a computer from a domain. This command supports the following additional parameters:
1871 <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>
1873 <listitem><para><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</para></listitem>
1875 <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>
1880 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.
1884 net dom unjoin -S xp -U XP\\administrator%secret account=MYDOM\\administrator password=topsecret reboot.
1887 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.
1893 <title>DOM RENAMECOMPUTER <replaceable>newname=NEWNAME</replaceable> <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
1896 Renames a computer that is joined to a domain. This command supports the following additional parameters:
1901 <listitem><para><replaceable>NEWNAME</replaceable> defines the new name of the machine in the domain.</para></listitem>
1903 <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>
1905 <listitem><para><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</para></listitem>
1907 <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>
1912 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.
1916 net dom renamecomputer -S xp -U XP\\administrator%secret newname=XPNEW account=MYDOM\\administrator password=topsecret reboot.
1919 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.
1927 <title>G_LOCK</title>
1929 <para>Manage global locks.</para>
1932 <title>G_LOCK DO <replaceable>lockname</replaceable> <replaceable>timeout</replaceable> <replaceable>command</replaceable></title>
1935 Execute a shell command under a global lock. This might be useful to define the
1936 order in which several shell commands will be executed. The locking information
1937 is stored in a file called <filename>g_lock.tdb</filename>. In setups with CTDB
1938 running, the locking information will be available on all cluster nodes.
1942 <listitem><para><replaceable>LOCKNAME</replaceable> defines the name of the global lock.</para></listitem>
1943 <listitem><para><replaceable>TIMEOUT</replaceable> defines the timeout.</para></listitem>
1944 <listitem><para><replaceable>COMMAND</replaceable> defines the shell command to execute.</para></listitem>
1949 <title>G_LOCK LOCKS</title>
1952 Print a list of all currently existing locknames.
1957 <title>G_LOCK DUMP <replaceable>lockname</replaceable></title>
1960 Dump the locking table of a certain global lock.
1967 <title>HELP [COMMAND]</title>
1969 <para>Gives usage information for the specified command.</para>
1976 <title>VERSION</title>
1978 <para>This man page is complete for version 3 of the Samba
1983 <title>AUTHOR</title>
1985 <para>The original Samba software and related utilities
1986 were created by Andrew Tridgell. Samba is now developed
1987 by the Samba Team as an Open Source project similar
1988 to the way the Linux kernel is developed.</para>
1990 <para>The net manpage was written by Jelmer Vernooij.</para>