source: vendor/3.6.23/docs-xml/manpages-3/net.8.xml

Last change on this file was 860, checked in by Silvan Scherrer, 11 years ago

Samba 3.6: updated vendor to latest version

File size: 61.9 KB
Line 
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">
3<refentry id="net.8">
4
5<refmeta>
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>
11</refmeta>
12
13
14<refnamediv>
15 <refname>net</refname>
16 <refpurpose>Tool for administration of Samba and remote
17 CIFS servers.
18 </refpurpose>
19</refnamediv>
20
21<refsynopsisdiv>
22 <cmdsynopsis>
23 <command>net</command>
24 <arg choice="req">&lt;ads|rap|rpc&gt;</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>
39 </cmdsynopsis>
40</refsynopsisdiv>
41
42<refsect1>
43 <title>DESCRIPTION</title>
44
45 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
46 <manvolnum>7</manvolnum></citerefentry> suite.</para>
47
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.
55 </para>
56
57</refsect1>
58
59<refsect1>
60 <title>OPTIONS</title>
61
62 <variablelist>
63 &stdarg.help;
64 &stdarg.kerberos;
65
66 <varlistentry>
67 <term>-w target-workgroup</term>
68 <listitem><para>
69 Sets target workgroup or domain. You have to specify
70 either this option or the IP address or the name of a server.
71 </para></listitem>
72 </varlistentry>
73
74 <varlistentry>
75 <term>-W workgroup</term>
76 <listitem><para>
77 Sets client workgroup or domain
78 </para></listitem>
79 </varlistentry>
80
81 <varlistentry>
82 <term>-U user</term>
83 <listitem><para>
84 User name to use
85 </para></listitem>
86 </varlistentry>
87
88 <varlistentry>
89 <term>-I ip-address</term>
90 <listitem><para>
91 IP address of target server to use. You have to
92 specify either this option or a target workgroup or
93 a target server.
94 </para></listitem>
95 </varlistentry>
96
97 <varlistentry>
98 <term>-p port</term>
99 <listitem><para>
100 Port on the target server to connect to (usually 139 or 445).
101 Defaults to trying 445 first, then 139.
102 </para></listitem>
103 </varlistentry>
104
105 &stdarg.netbios.name;
106 &stdarg.configfile;
107
108 <varlistentry>
109 <term>-S server</term>
110 <listitem><para>
111 Name of target server. You should specify either
112 this option or a target workgroup or a target IP address.
113 </para></listitem>
114 </varlistentry>
115
116 <varlistentry>
117 <term>-l</term>
118 <listitem><para>
119 When listing data, give more information on each item.
120 </para></listitem>
121 </varlistentry>
122
123 <varlistentry>
124 <term>-P</term>
125 <listitem><para>
126 Make queries to the external server using the machine account of the local server.
127 </para></listitem>
128 </varlistentry>
129
130 <varlistentry>
131 <term>--request-timeout 30</term>
132 <listitem><para>
133 Let client requests timeout after 30 seconds the default is 10
134 seconds.
135 </para></listitem>
136 </varlistentry>
137
138 &stdarg.server.debug;
139 </variablelist>
140</refsect1>
141
142<refsect1>
143<title>COMMANDS</title>
144
145<refsect2>
146<title>CHANGESECRETPW</title>
147
148<para>This command allows the Samba machine account password to be set from an external application
149to a machine account password that has already been stored in Active Directory. DO NOT USE this command
150unless you know exactly what you are doing. The use of this command requires that the force flag (-f)
151be used also. There will be NO command prompt. Whatever information is piped into stdin, either by
152typing at the command line or otherwise, will be stored as the literal machine password. Do NOT use
153this without care and attention as it will overwrite a legitimate machine password without warning.
154YOU HAVE BEEN WARNED.
155</para>
156
157</refsect2>
158
159<refsect2>
160 <title>TIME</title>
161
162 <para>The <command>NET TIME</command> command allows you to view the time on a remote server
163 or synchronise the time on the local server with the time on the remote server.</para>
164
165<refsect3>
166<title>TIME</title>
167
168<para>Without any options, the <command>NET TIME</command> command
169displays the time on the remote server.
170</para>
171
172</refsect3>
173
174<refsect3>
175<title>TIME SYSTEM</title>
176
177<para>Displays the time on the remote server in a format ready for <command>/bin/date</command>.</para>
178
179</refsect3>
180
181<refsect3>
182<title>TIME SET</title>
183<para>Tries to set the date and time of the local server to that on
184the remote server using <command>/bin/date</command>. </para>
185
186</refsect3>
187
188<refsect3>
189<title>TIME ZONE</title>
190
191<para>Displays the timezone in hours from GMT on the remote computer.</para>
192
193</refsect3>
194</refsect2>
195
196<refsect2>
197<title>[RPC|ADS] JOIN [TYPE] [-U username[%password]] [createupn=UPN] [createcomputer=OU] [options]</title>
198
199<para>
200Join a domain. If the account already exists on the server, and
201[TYPE] is MEMBER, the machine will attempt to join automatically.
202(Assuming that the machine has been created in server manager)
203Otherwise, a password will be prompted for, and a new account may
204be created.</para>
205
206<para>
207[TYPE] may be PDC, BDC or MEMBER to specify the type of server
208joining the domain.
209</para>
210
211<para>
212[UPN] (ADS only) set the principalname attribute during the join. The default
213format is host/netbiosname@REALM.
214</para>
215
216<para>
217[OU] (ADS only) Precreate the computer account in a specific OU. The
218OU string reads from top to bottom without RDNs, and is delimited by
219a '/'. Please note that '\' is used for escape by both the shell
220and ldap, so it may need to be doubled or quadrupled to pass through,
221and it is not used as a delimiter.
222</para>
223</refsect2>
224
225<refsect2>
226<title>[RPC] OLDJOIN [options]</title>
227
228<para>Join a domain. Use the OLDJOIN option to join the domain
229using the old style of domain joining - you need to create a trust
230account in server manager first.</para>
231</refsect2>
232
233<refsect2>
234<title>[RPC|ADS] USER</title>
235
236<refsect3>
237<title>[RPC|ADS] USER</title>
238
239<para>List all users</para>
240
241</refsect3>
242
243<refsect3>
244<title>[RPC|ADS] USER DELETE <replaceable>target</replaceable></title>
245
246<para>Delete specified user</para>
247
248</refsect3>
249
250<refsect3>
251<title>[RPC|ADS] USER INFO <replaceable>target</replaceable></title>
252
253<para>List the domain groups of the specified user.</para>
254
255</refsect3>
256
257<refsect3>
258<title>[RPC|ADS] USER RENAME <replaceable>oldname</replaceable> <replaceable>newname</replaceable></title>
259
260<para>Rename specified user.</para>
261
262</refsect3>
263
264<refsect3>
265<title>[RPC|ADS] USER ADD <replaceable>name</replaceable> [password] [-F user flags] [-C comment]</title>
266
267<para>Add specified user.</para>
268</refsect3>
269</refsect2>
270
271<refsect2>
272<title>[RPC|ADS] GROUP</title>
273
274<refsect3>
275<title>[RPC|ADS] GROUP [misc options] [targets]</title>
276<para>List user groups.</para>
277</refsect3>
278
279<refsect3>
280<title>[RPC|ADS] GROUP DELETE <replaceable>name</replaceable> [misc. options]</title>
281
282<para>Delete specified group.</para>
283
284</refsect3>
285
286<refsect3>
287<title>[RPC|ADS] GROUP ADD <replaceable>name</replaceable> [-C comment]</title>
288
289<para>Create specified group.</para>
290
291</refsect3>
292</refsect2>
293
294<refsect2>
295<title>[RAP|RPC] SHARE</title>
296
297<refsect3>
298<title>[RAP|RPC] SHARE [misc. options] [targets]</title>
299
300<para>Enumerates all exported resources (network shares) on target server.</para>
301
302</refsect3>
303
304<refsect3>
305<title>[RAP|RPC] SHARE ADD <replaceable>name=serverpath</replaceable> [-C comment] [-M maxusers] [targets]</title>
306
307<para>Adds a share from a server (makes the export active). Maxusers
308specifies the number of users that can be connected to the
309share simultaneously.</para>
310
311</refsect3>
312
313<refsect3>
314<title>SHARE DELETE <replaceable>sharename</replaceable></title>
315
316<para>Delete specified share.</para>
317</refsect3>
318</refsect2>
319
320<refsect2>
321<title>[RPC|RAP] FILE</title>
322
323<refsect3>
324<title>[RPC|RAP] FILE</title>
325
326<para>List all open files on remote server.</para>
327
328</refsect3>
329
330<refsect3>
331<title>[RPC|RAP] FILE CLOSE <replaceable>fileid</replaceable></title>
332
333<para>Close file with specified <replaceable>fileid</replaceable> on
334remote server.</para>
335
336</refsect3>
337
338<refsect3>
339<title>[RPC|RAP] FILE INFO <replaceable>fileid</replaceable></title>
340
341<para>
342Print information on specified <replaceable>fileid</replaceable>.
343Currently listed are: file-id, username, locks, path, permissions.
344</para>
345
346</refsect3>
347
348<refsect3>
349<title>[RAP|RPC] FILE USER <replaceable>user</replaceable></title>
350
351<para>
352List files opened by specified <replaceable>user</replaceable>.
353Please note that <command>net rap file user</command> does not work
354against Samba servers.
355</para>
356
357</refsect3>
358
359</refsect2>
360
361<refsect2>
362<title>SESSION</title>
363
364<refsect3>
365<title>RAP SESSION</title>
366
367<para>Without any other options, SESSION enumerates all active SMB/CIFS
368sessions on the target server.</para>
369
370</refsect3>
371
372<refsect3>
373<title>RAP SESSION DELETE|CLOSE <replaceable>CLIENT_NAME</replaceable></title>
374
375<para>Close the specified sessions.</para>
376
377</refsect3>
378
379<refsect3>
380<title>RAP SESSION INFO <replaceable>CLIENT_NAME</replaceable></title>
381
382<para>Give a list with all the open files in specified session.</para>
383
384</refsect3>
385
386</refsect2>
387
388<refsect2>
389<title>RAP SERVER <replaceable>DOMAIN</replaceable></title>
390
391<para>List all servers in specified domain or workgroup. Defaults
392to local domain.</para>
393
394</refsect2>
395
396<refsect2>
397<title>RAP DOMAIN</title>
398
399<para>Lists all domains and workgroups visible on the
400current network.</para>
401
402</refsect2>
403
404<refsect2>
405<title>RAP PRINTQ</title>
406
407<refsect3>
408<title>RAP PRINTQ INFO <replaceable>QUEUE_NAME</replaceable></title>
409
410<para>Lists the specified print queue and print jobs on the server.
411If the <replaceable>QUEUE_NAME</replaceable> is omitted, all
412queues are listed.</para>
413
414</refsect3>
415
416<refsect3>
417<title>RAP PRINTQ DELETE <replaceable>JOBID</replaceable></title>
418
419<para>Delete job with specified id.</para>
420
421</refsect3>
422
423</refsect2>
424
425<refsect2>
426<title>RAP VALIDATE <replaceable>user</replaceable> [<replaceable>password</replaceable>]</title>
427
428<para>
429Validate whether the specified user can log in to the
430remote server. If the password is not specified on the commandline, it
431will be prompted.
432</para>
433
434&not.implemented;
435
436</refsect2>
437
438<refsect2>
439<title>RAP GROUPMEMBER</title>
440
441<refsect3>
442<title>RAP GROUPMEMBER LIST <replaceable>GROUP</replaceable></title>
443
444<para>List all members of the specified group.</para>
445
446</refsect3>
447
448<refsect3>
449<title>RAP GROUPMEMBER DELETE <replaceable>GROUP</replaceable> <replaceable>USER</replaceable></title>
450
451<para>Delete member from group.</para>
452
453</refsect3>
454
455<refsect3>
456<title>RAP GROUPMEMBER ADD <replaceable>GROUP</replaceable> <replaceable>USER</replaceable></title>
457
458<para>Add member to group.</para>
459
460</refsect3>
461
462</refsect2>
463
464<refsect2>
465<title>RAP ADMIN <replaceable>command</replaceable></title>
466
467<para>Execute the specified <replaceable>command</replaceable> on
468the remote server. Only works with OS/2 servers.
469</para>
470
471&not.implemented;
472
473</refsect2>
474
475<refsect2>
476<title>RAP SERVICE</title>
477
478<refsect3>
479<title>RAP SERVICE START <replaceable>NAME</replaceable> [arguments...]</title>
480
481<para>Start the specified service on the remote server. Not implemented yet.</para>
482
483&not.implemented;
484
485</refsect3>
486
487<refsect3>
488<title>RAP SERVICE STOP</title>
489
490<para>Stop the specified service on the remote server.</para>
491
492&not.implemented;
493
494</refsect3>
495
496</refsect2>
497
498<refsect2>
499<title>RAP PASSWORD <replaceable>USER</replaceable> <replaceable>OLDPASS</replaceable> <replaceable>NEWPASS</replaceable></title>
500
501<para>
502Change password of <replaceable>USER</replaceable> from <replaceable>OLDPASS</replaceable> to <replaceable>NEWPASS</replaceable>.
503</para>
504
505</refsect2>
506
507<refsect2>
508<title>LOOKUP</title>
509
510<refsect3>
511<title>LOOKUP HOST <replaceable>HOSTNAME</replaceable> [<replaceable>TYPE</replaceable>]</title>
512
513<para>
514Lookup the IP address of the given host with the specified type (netbios suffix).
515The type defaults to 0x20 (workstation).
516</para>
517
518</refsect3>
519
520<refsect3>
521<title>LOOKUP LDAP [<replaceable>DOMAIN</replaceable>]</title>
522
523<para>Give IP address of LDAP server of specified <replaceable>DOMAIN</replaceable>. Defaults to local domain.</para>
524
525</refsect3>
526
527<refsect3>
528<title>LOOKUP KDC [<replaceable>REALM</replaceable>]</title>
529
530<para>Give IP address of KDC for the specified <replaceable>REALM</replaceable>.
531Defaults to local realm.</para>
532
533</refsect3>
534
535<refsect3>
536<title>LOOKUP DC [<replaceable>DOMAIN</replaceable>]</title>
537
538<para>Give IP's of Domain Controllers for specified <replaceable>
539DOMAIN</replaceable>. Defaults to local domain.</para>
540
541</refsect3>
542
543<refsect3>
544<title>LOOKUP MASTER <replaceable>DOMAIN</replaceable></title>
545
546<para>Give IP of master browser for specified <replaceable>DOMAIN</replaceable>
547or workgroup. Defaults to local domain.</para>
548
549</refsect3>
550
551</refsect2>
552
553<refsect2>
554<title>CACHE</title>
555
556<para>Samba uses a general caching interface called 'gencache'. It
557can be controlled using 'NET CACHE'.</para>
558
559<para>All the timeout parameters support the suffixes:
560
561<simplelist>
562<member>s - Seconds</member>
563<member>m - Minutes</member>
564<member>h - Hours</member>
565<member>d - Days</member>
566<member>w - Weeks</member>
567</simplelist>
568
569</para>
570
571<refsect3>
572<title>CACHE ADD <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable></title>
573
574<para>Add specified key+data to the cache with the given timeout.</para>
575
576</refsect3>
577
578<refsect3>
579<title>CACHE DEL <replaceable>key</replaceable></title>
580
581<para>Delete key from the cache.</para>
582
583</refsect3>
584
585<refsect3>
586<title>CACHE SET <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable></title>
587
588<para>Update data of existing cache entry.</para>
589
590</refsect3>
591
592<refsect3>
593<title>CACHE SEARCH <replaceable>PATTERN</replaceable></title>
594
595<para>Search for the specified pattern in the cache data.</para>
596
597</refsect3>
598
599<refsect3>
600<title>CACHE LIST</title>
601
602<para>
603List all current items in the cache.
604</para>
605
606</refsect3>
607
608<refsect3>
609<title>CACHE FLUSH</title>
610
611<para>Remove all the current items from the cache.</para>
612
613</refsect3>
614
615</refsect2>
616
617<refsect2>
618<title>GETLOCALSID [DOMAIN]</title>
619
620<para>Prints the SID of the specified domain, or if the parameter is
621omitted, the SID of the local server.</para>
622
623</refsect2>
624
625<refsect2>
626<title>SETLOCALSID S-1-5-21-x-y-z</title>
627
628<para>Sets SID for the local server to the specified SID.</para>
629
630</refsect2>
631
632<refsect2>
633<title>GETDOMAINSID</title>
634
635<para>Prints the local machine SID and the SID of the current
636domain.</para>
637
638</refsect2>
639
640<refsect2>
641<title>SETDOMAINSID</title>
642
643<para>Sets the SID of the current domain.</para>
644
645</refsect2>
646
647<refsect2>
648<title>GROUPMAP</title>
649
650<para>Manage the mappings between Windows group SIDs and UNIX groups.
651Common options include:</para>
652
653<itemizedlist>
654<listitem><para>unixgroup - Name of the UNIX group</para></listitem>
655<listitem><para>ntgroup - Name of the Windows NT group (must be
656 resolvable to a SID</para></listitem>
657<listitem><para>rid - Unsigned 32-bit integer</para></listitem>
658<listitem><para>sid - Full SID in the form of "S-1-..."</para></listitem>
659<listitem><para>type - Type of the group; either 'domain', 'local',
660 or 'builtin'</para></listitem>
661<listitem><para>comment - Freeform text description of the group</para></listitem>
662</itemizedlist>
663
664<refsect3>
665<title>GROUPMAP ADD</title>
666
667<para>
668Add a new group mapping entry:
669<programlisting>
670net groupmap add {rid=int|sid=string} unixgroup=string \
671 [type={domain|local}] [ntgroup=string] [comment=string]
672</programlisting>
673</para>
674
675</refsect3>
676
677<refsect3>
678<title>GROUPMAP DELETE</title>
679
680<para>Delete a group mapping entry. If more than one group name matches, the first entry found is deleted.</para>
681
682<para>net groupmap delete {ntgroup=string|sid=SID}</para>
683
684</refsect3>
685
686<refsect3>
687<title>GROUPMAP MODIFY</title>
688
689<para>Update en existing group entry.</para>
690
691<para>
692<programlisting>
693net groupmap modify {ntgroup=string|sid=SID} [unixgroup=string] \
694 [comment=string] [type={domain|local}]
695</programlisting>
696</para>
697</refsect3>
698
699<refsect3>
700<title>GROUPMAP LIST</title>
701
702<para>List existing group mapping entries.</para>
703
704<para>net groupmap list [verbose] [ntgroup=string] [sid=SID]</para>
705
706</refsect3>
707</refsect2>
708
709
710
711<refsect2>
712<title>MAXRID</title>
713
714<para>Prints out the highest RID currently in use on the local
715server (by the active 'passdb backend').
716</para>
717
718</refsect2>
719
720<refsect2>
721<title>RPC INFO</title>
722
723<para>Print information about the domain of the remote server,
724such as domain name, domain sid and number of users and groups.
725</para>
726
727</refsect2>
728
729<refsect2>
730<title>[RPC|ADS] TESTJOIN</title>
731
732<para>Check whether participation in a domain is still valid.</para>
733
734</refsect2>
735
736<refsect2>
737<title>[RPC|ADS] CHANGETRUSTPW</title>
738
739<para>Force change of domain trust password.</para>
740
741</refsect2>
742
743<refsect2>
744<title>RPC TRUSTDOM</title>
745
746<refsect3>
747<title>RPC TRUSTDOM ADD <replaceable>DOMAIN</replaceable></title>
748
749<para>Add a interdomain trust account for <replaceable>DOMAIN</replaceable>.
750This is in fact a Samba account named <replaceable>DOMAIN$</replaceable>
751with the account flag <constant>'I'</constant> (interdomain trust account).
752This is required for incoming trusts to work. It makes Samba be a
753trusted domain of the foreign (trusting) domain.
754Users of the Samba domain will be made available in the foreign domain.
755If the command is used against localhost it has the same effect as
756<command>smbpasswd -a -i DOMAIN</command>. Please note that both commands
757expect a appropriate UNIX account.
758</para>
759
760</refsect3>
761
762<refsect3>
763<title>RPC TRUSTDOM DEL <replaceable>DOMAIN</replaceable></title>
764
765<para>Remove interdomain trust account for
766<replaceable>DOMAIN</replaceable>. If it is used against localhost
767it has the same effect as <command>smbpasswd -x DOMAIN$</command>.
768</para>
769
770</refsect3>
771
772<refsect3>
773<title>RPC TRUSTDOM ESTABLISH <replaceable>DOMAIN</replaceable></title>
774
775<para>
776Establish a trust relationship to a trusted domain.
777Interdomain account must already be created on the remote PDC.
778This is required for outgoing trusts to work. It makes Samba be a
779trusting domain of a foreign (trusted) domain.
780Users of the foreign domain will be made available in our domain.
781You'll need winbind and a working idmap config to make them
782appear in your system.
783</para>
784
785</refsect3>
786
787<refsect3>
788<title>RPC TRUSTDOM REVOKE <replaceable>DOMAIN</replaceable></title>
789<para>Abandon relationship to trusted domain</para>
790
791</refsect3>
792
793<refsect3>
794<title>RPC TRUSTDOM LIST</title>
795
796<para>List all interdomain trust relationships.</para>
797
798</refsect3>
799<refsect3>
800<title>RPC TRUSTDOM LIST</title>
801
802<para>List all interdomain trust relationships.</para>
803
804</refsect3>
805</refsect2>
806
807<refsect2>
808<title>RPC TRUST</title>
809
810<refsect3>
811<title>RPC TRUST CREATE</title>
812
813<para>Create a trust trust object by calling lsaCreateTrustedDomainEx2.
814The can be done on a single server or on two servers at once with the
815possibility to use a random trust password.</para>
816
817<variablelist><title>Options:</title>
818<varlistentry>
819<term>otherserver</term>
820<listitem><para>Domain controller of the second domain</para></listitem>
821</varlistentry>
822
823<varlistentry>
824<term>otheruser</term>
825<listitem><para>Admin user in the second domain</para></listitem>
826</varlistentry>
827
828<varlistentry>
829<term>otherdomainsid</term>
830<listitem><para>SID of the second domain</para></listitem>
831</varlistentry>
832
833<varlistentry>
834<term>other_netbios_domain</term>
835<listitem><para>NetBIOS (short) name of the second domain</para></listitem>
836</varlistentry>
837
838<varlistentry>
839<term>otherdomain</term>
840<listitem><para>DNS (full) name of the second domain</para></listitem>
841</varlistentry>
842
843<varlistentry>
844<term>trustpw</term>
845<listitem><para>Trust password</para></listitem>
846</varlistentry>
847</variablelist>
848
849<variablelist><title>Examples:</title>
850<varlistentry>
851<term>Create a trust object on srv1.dom1.dom for the domain dom2</term>
852<listitem><literallayout>
853net rpc trust create \
854 otherdomainsid=S-x-x-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxx \
855 other_netbios_domain=dom2 \
856 otherdomain=dom2.dom \
857 trustpw=12345678 \
858 -S srv1.dom1.dom
859</literallayout></listitem>
860</varlistentry>
861<varlistentry>
862<term>Create a trust relationship between dom1 and dom2</term>
863<listitem><literallayout>
864net rpc trust create \
865 otherserver=srv2.dom2.test \
866 otheruser=dom2adm \
867 -S srv1.dom1.dom
868</literallayout></listitem>
869</varlistentry>
870</variablelist>
871</refsect3>
872
873<refsect3>
874<title>RPC TRUST DELETE</title>
875
876<para>Delete a trust trust object by calling lsaDeleteTrustedDomain.
877The can be done on a single server or on two servers at once.</para>
878
879<variablelist><title>Options:</title>
880<varlistentry>
881<term>otherserver</term>
882<listitem><para>Domain controller of the second domain</para></listitem>
883</varlistentry>
884
885<varlistentry>
886<term>otheruser</term>
887<listitem><para>Admin user in the second domain</para></listitem>
888</varlistentry>
889
890<varlistentry>
891<term>otherdomainsid</term>
892<listitem><para>SID of the second domain</para></listitem>
893</varlistentry>
894</variablelist>
895
896<variablelist><title>Examples:</title>
897<varlistentry>
898<term>Delete a trust object on srv1.dom1.dom for the domain dom2</term>
899<listitem><literallayout>
900net rpc trust delete \
901 otherdomainsid=S-x-x-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxx \
902 -S srv1.dom1.dom
903</literallayout></listitem>
904</varlistentry>
905<varlistentry>
906<term>Delete a trust relationship between dom1 and dom2</term>
907<listitem><literallayout>
908net rpc trust delete \
909 otherserver=srv2.dom2.test \
910 otheruser=dom2adm \
911 -S srv1.dom1.dom
912</literallayout></listitem>
913</varlistentry>
914</variablelist>
915</refsect3>
916
917</refsect2>
918
919<refsect2>
920<refsect3>
921<title>RPC RIGHTS</title>
922
923<para>This subcommand is used to view and manage Samba's rights assignments (also
924referred to as privileges). There are three options currently available:
925<parameter>list</parameter>, <parameter>grant</parameter>, and
926<parameter>revoke</parameter>. More details on Samba's privilege model and its use
927can be found in the Samba-HOWTO-Collection.</para>
928
929</refsect3>
930
931
932</refsect2>
933
934<refsect2>
935<title>RPC ABORTSHUTDOWN</title>
936
937<para>Abort the shutdown of a remote server.</para>
938
939</refsect2>
940
941<refsect2>
942<title>RPC SHUTDOWN [-t timeout] [-r] [-f] [-C message]</title>
943
944<para>Shut down the remote server.</para>
945
946<variablelist>
947<varlistentry>
948<term>-r</term>
949<listitem><para>
950Reboot after shutdown.
951</para></listitem>
952</varlistentry>
953
954<varlistentry>
955<term>-f</term>
956<listitem><para>
957Force shutting down all applications.
958</para></listitem>
959</varlistentry>
960
961<varlistentry>
962<term>-t timeout</term>
963<listitem><para>
964Timeout before system will be shut down. An interactive
965user of the system can use this time to cancel the shutdown.
966</para></listitem>
967</varlistentry>
968
969<varlistentry>
970<term>-C message</term>
971<listitem><para>Display the specified message on the screen to
972announce the shutdown.</para></listitem>
973</varlistentry>
974</variablelist>
975
976</refsect2>
977
978<refsect2>
979<title>RPC SAMDUMP</title>
980
981<para>Print out sam database of remote server. You need
982to run this against the PDC, from a Samba machine joined as a BDC. </para>
983</refsect2>
984
985<refsect2>
986<title>RPC VAMPIRE</title>
987
988<para>Export users, aliases and groups from remote server to
989local server. You need to run this against the PDC, from a Samba machine joined as a BDC.
990</para>
991</refsect2>
992
993<refsect2>
994<title>RPC VAMPIRE KEYTAB</title>
995
996<para>Dump remote SAM database to local Kerberos keytab file.
997</para>
998</refsect2>
999
1000<refsect2>
1001<title>RPC VAMPIRE LDIF</title>
1002
1003<para>Dump remote SAM database to local LDIF file or standard output.
1004</para>
1005</refsect2>
1006
1007<refsect2>
1008<title>RPC GETSID</title>
1009
1010<para>Fetch domain SID and store it in the local <filename>secrets.tdb</filename>. </para>
1011
1012</refsect2>
1013
1014<refsect2>
1015<title>ADS LEAVE</title>
1016
1017<para>Make the remote host leave the domain it is part of. </para>
1018
1019</refsect2>
1020
1021<refsect2>
1022<title>ADS STATUS</title>
1023
1024<para>Print out status of machine account of the local machine in ADS.
1025Prints out quite some debug info. Aimed at developers, regular
1026users should use <command>NET ADS TESTJOIN</command>.</para>
1027
1028</refsect2>
1029
1030<refsect2>
1031<title>ADS PRINTER</title>
1032
1033<refsect3>
1034<title>ADS PRINTER INFO [<replaceable>PRINTER</replaceable>] [<replaceable>SERVER</replaceable>]</title>
1035
1036<para>
1037Lookup info for <replaceable>PRINTER</replaceable> on <replaceable>SERVER</replaceable>. The printer name defaults to "*", the
1038server name defaults to the local host.</para>
1039
1040</refsect3>
1041
1042<refsect3>
1043<title>ADS PRINTER PUBLISH <replaceable>PRINTER</replaceable></title>
1044
1045<para>Publish specified printer using ADS.</para>
1046
1047</refsect3>
1048
1049<refsect3>
1050<title>ADS PRINTER REMOVE <replaceable>PRINTER</replaceable></title>
1051
1052<para>Remove specified printer from ADS directory.</para>
1053
1054</refsect3>
1055
1056</refsect2>
1057
1058<refsect2>
1059<title>ADS SEARCH <replaceable>EXPRESSION</replaceable> <replaceable>ATTRIBUTES...</replaceable></title>
1060
1061<para>Perform a raw LDAP search on a ADS server and dump the results. The
1062expression is a standard LDAP search expression, and the
1063attributes are a list of LDAP fields to show in the results.</para>
1064
1065<para>Example: <userinput>net ads search '(objectCategory=group)' sAMAccountName</userinput>
1066</para>
1067
1068</refsect2>
1069
1070<refsect2>
1071<title>ADS DN <replaceable>DN</replaceable> <replaceable>(attributes)</replaceable></title>
1072
1073<para>
1074Perform a raw LDAP search on a ADS server and dump the results. The
1075DN standard LDAP DN, and the attributes are a list of LDAP fields
1076to show in the result.
1077</para>
1078
1079<para>Example: <userinput>net ads dn 'CN=administrator,CN=Users,DC=my,DC=domain' SAMAccountName</userinput></para>
1080
1081</refsect2>
1082
1083<refsect2>
1084<title>ADS WORKGROUP</title>
1085
1086<para>Print out workgroup name for specified kerberos realm.</para>
1087
1088</refsect2>
1089
1090<refsect2>
1091<title>SAM CREATEBUILTINGROUP &lt;NAME&gt;</title>
1092
1093<para>
1094(Re)Create a BUILTIN group.
1095Only a wellknown set of BUILTIN groups can be created with this command.
1096This is the list of currently recognized group names: Administrators,
1097Users, Guests, Power Users, Account Operators, Server Operators, Print
1098Operators, Backup Operators, Replicator, RAS Servers, Pre-Windows 2000
1099compatible Access.
1100
1101This command requires a running Winbindd with idmap allocation properly
1102configured. The group gid will be allocated out of the winbindd range.
1103</para>
1104
1105</refsect2>
1106
1107<refsect2>
1108<title>SAM CREATELOCALGROUP &lt;NAME&gt;</title>
1109
1110<para>
1111Create a LOCAL group (also known as Alias).
1112
1113This command requires a running Winbindd with idmap allocation properly
1114configured. The group gid will be allocated out of the winbindd range.
1115</para>
1116
1117</refsect2>
1118
1119<refsect2>
1120<title>SAM DELETELOCALGROUP &lt;NAME&gt;</title>
1121
1122<para>
1123Delete an existing LOCAL group (also known as Alias).
1124
1125</para>
1126
1127</refsect2>
1128
1129<refsect2>
1130<title>SAM MAPUNIXGROUP &lt;NAME&gt;</title>
1131
1132<para>
1133Map an existing Unix group and make it a Domain Group, the domain group
1134will have the same name.
1135</para>
1136
1137</refsect2>
1138
1139<refsect2>
1140<title>SAM UNMAPUNIXGROUP &lt;NAME&gt;</title>
1141
1142<para>
1143Remove an existing group mapping entry.
1144</para>
1145
1146</refsect2>
1147
1148<refsect2>
1149<title>SAM ADDMEM &lt;GROUP&gt; &lt;MEMBER&gt;</title>
1150
1151<para>
1152Add a member to a Local group. The group can be specified only by name,
1153the member can be specified by name or SID.
1154</para>
1155
1156</refsect2>
1157
1158<refsect2>
1159<title>SAM DELMEM &lt;GROUP&gt; &lt;MEMBER&gt;</title>
1160
1161<para>
1162Remove a member from a Local group. The group and the member must be
1163specified by name.
1164</para>
1165
1166</refsect2>
1167
1168<refsect2>
1169<title>SAM LISTMEM &lt;GROUP&gt;</title>
1170
1171<para>
1172List Local group members. The group must be specified by name.
1173</para>
1174
1175</refsect2>
1176
1177<refsect2>
1178<title>SAM LIST &lt;users|groups|localgroups|builtin|workstations&gt; [verbose]</title>
1179
1180<para>
1181List the specified set of accounts by name. If verbose is specified,
1182the rid and description is also provided for each account.
1183</para>
1184
1185</refsect2>
1186
1187<refsect2>
1188<title>SAM RIGHTS LIST</title>
1189
1190<para>
1191List all available privileges.
1192</para>
1193
1194</refsect2>
1195
1196<refsect2>
1197<title>SAM RIGHTS GRANT &lt;NAME&gt; &lt;PRIVILEGE&gt;</title>
1198
1199<para>
1200Grant one or more privileges to a user.
1201</para>
1202
1203</refsect2>
1204
1205<refsect2>
1206<title>SAM RIGHTS REVOKE &lt;NAME&gt; &lt;PRIVILEGE&gt;</title>
1207
1208<para>
1209Revoke one or more privileges from a user.
1210</para>
1211
1212</refsect2>
1213
1214<refsect2>
1215<title>SAM SHOW &lt;NAME&gt;</title>
1216
1217<para>
1218Show the full DOMAIN\\NAME the SID and the type for the corresponding
1219account.
1220</para>
1221
1222</refsect2>
1223
1224<refsect2>
1225<title>SAM SET HOMEDIR &lt;NAME&gt; &lt;DIRECTORY&gt;</title>
1226
1227<para>
1228Set the home directory for a user account.
1229</para>
1230
1231</refsect2>
1232
1233<refsect2>
1234<title>SAM SET PROFILEPATH &lt;NAME&gt; &lt;PATH&gt;</title>
1235
1236<para>
1237Set the profile path for a user account.
1238</para>
1239
1240</refsect2>
1241
1242<refsect2>
1243<title>SAM SET COMMENT &lt;NAME&gt; &lt;COMMENT&gt;</title>
1244
1245<para>
1246Set the comment for a user or group account.
1247</para>
1248
1249</refsect2>
1250
1251<refsect2>
1252<title>SAM SET FULLNAME &lt;NAME&gt; &lt;FULL NAME&gt;</title>
1253
1254<para>
1255Set the full name for a user account.
1256</para>
1257
1258</refsect2>
1259
1260<refsect2>
1261<title>SAM SET LOGONSCRIPT &lt;NAME&gt; &lt;SCRIPT&gt;</title>
1262
1263<para>
1264Set the logon script for a user account.
1265</para>
1266
1267</refsect2>
1268
1269<refsect2>
1270<title>SAM SET HOMEDRIVE &lt;NAME&gt; &lt;DRIVE&gt;</title>
1271
1272<para>
1273Set the home drive for a user account.
1274</para>
1275
1276</refsect2>
1277
1278<refsect2>
1279<title>SAM SET WORKSTATIONS &lt;NAME&gt; &lt;WORKSTATIONS&gt;</title>
1280
1281<para>
1282Set the workstations a user account is allowed to log in from.
1283</para>
1284
1285</refsect2>
1286
1287<refsect2>
1288<title>SAM SET DISABLE &lt;NAME&gt;</title>
1289
1290<para>
1291Set the "disabled" flag for a user account.
1292</para>
1293
1294</refsect2>
1295
1296<refsect2>
1297<title>SAM SET PWNOTREQ &lt;NAME&gt;</title>
1298
1299<para>
1300Set the "password not required" flag for a user account.
1301</para>
1302
1303</refsect2>
1304
1305<refsect2>
1306<title>SAM SET AUTOLOCK &lt;NAME&gt;</title>
1307
1308<para>
1309Set the "autolock" flag for a user account.
1310</para>
1311
1312</refsect2>
1313
1314<refsect2>
1315<title>SAM SET PWNOEXP &lt;NAME&gt;</title>
1316
1317<para>
1318Set the "password do not expire" flag for a user account.
1319</para>
1320
1321</refsect2>
1322
1323<refsect2>
1324<title>SAM SET PWDMUSTCHANGENOW &lt;NAME&gt; [yes|no]</title>
1325
1326<para>
1327Set or unset the "password must change" flag for a user account.
1328</para>
1329
1330</refsect2>
1331
1332<refsect2>
1333<title>SAM POLICY LIST</title>
1334
1335<para>
1336List the available account policies.
1337</para>
1338
1339</refsect2>
1340
1341<refsect2>
1342<title>SAM POLICY SHOW &lt;account policy&gt;</title>
1343
1344<para>
1345Show the account policy value.
1346</para>
1347
1348</refsect2>
1349
1350<refsect2>
1351<title>SAM POLICY SET &lt;account policy&gt; &lt;value&gt;</title>
1352
1353<para>
1354Set a value for the account policy.
1355Valid values can be: "forever", "never", "off", or a number.
1356</para>
1357
1358</refsect2>
1359
1360<refsect2>
1361<title>SAM PROVISION</title>
1362
1363<para>
1364Only available if ldapsam:editposix is set and winbindd is running.
1365Properly populates the ldap tree with the basic accounts (Administrator)
1366and groups (Domain Users, Domain Admins, Domain Guests) on the ldap tree.
1367</para>
1368
1369</refsect2>
1370
1371<refsect2>
1372<title>IDMAP DUMP &lt;local tdb file name&gt;</title>
1373
1374<para>
1375Dumps the mappings contained in the local tdb file specified.
1376This command is useful to dump only the mappings produced by the idmap_tdb backend.
1377</para>
1378
1379</refsect2>
1380
1381<refsect2>
1382<title>IDMAP RESTORE [input file]</title>
1383
1384<para>
1385Restore the mappings from the specified file or stdin.
1386</para>
1387
1388</refsect2>
1389
1390<refsect2>
1391<title>IDMAP SECRET &lt;DOMAIN&gt; &lt;secret&gt;</title>
1392
1393<para>
1394Store a secret for the specified domain, used primarily for domains
1395that use idmap_ldap as a backend. In this case the secret is used
1396as the password for the user DN used to bind to the ldap server.
1397</para>
1398
1399</refsect2>
1400
1401<refsect2>
1402
1403<title>IDMAP DELETE [-f] [--db=&lt;DB&gt;] &lt;ID&gt;</title>
1404
1405<para>
1406Delete a mapping sid &lt;-&gt; gid or sid &lt;-&gt; uid from the IDMAP database.
1407The mapping is given by &lt;ID&gt; which may either be a sid: S-x-..., a gid: "GID number" or a uid: "UID number".
1408Use -f to delete an invalid partial mapping &lt;ID&gt; -&gt; xx
1409</para>
1410<para>
1411 Use "smbcontrol all idmap ..." to notify running smbd instances.
1412 See the <citerefentry><refentrytitle>smbcontrol</refentrytitle>
1413 <manvolnum>1</manvolnum></citerefentry> manpage for details.
1414</para>
1415</refsect2>
1416
1417<refsect2>
1418
1419<title>IDMAP CHECK [-v] [-r] [-a] [-T] [-f] [-l] [--db=&lt;DB&gt;]</title>
1420
1421<para>
1422 Check and repair the IDMAP database. If no option is given a read only check
1423 of the database is done. Among others an interactive or automatic repair mode
1424 may be chosen with one of the following options:
1425
1426 <variablelist>
1427 <varlistentry><term>-r|--repair</term>
1428 <listitem><para>
1429 Interactive repair mode, ask a lot of questions.
1430 </para></listitem>
1431 </varlistentry>
1432
1433 <varlistentry><term>-a|--auto</term>
1434 <listitem><para>
1435 Noninteractive repair mode, use default answers.
1436 </para></listitem>
1437 </varlistentry>
1438
1439 <varlistentry><term>-v|--verbose</term>
1440 <listitem><para>
1441 Produce more output.
1442 </para></listitem>
1443 </varlistentry>
1444
1445 <varlistentry><term>-f|--force</term>
1446 <listitem><para>
1447 Try to apply changes, even if they do not apply cleanly.
1448 </para></listitem>
1449 </varlistentry>
1450
1451 <varlistentry><term>-T|--test</term>
1452 <listitem><para>
1453 Dry run, show what changes would be made but don't touch anything.
1454 </para></listitem>
1455 </varlistentry>
1456
1457 <varlistentry><term>-l|--lock</term>
1458 <listitem><para>
1459 Lock the database while doing the check.
1460 </para></listitem>
1461 </varlistentry>
1462
1463 <varlistentry><term>--db &lt;DB&gt;</term>
1464 <listitem><para>
1465 Check the specified database.
1466 </para></listitem>
1467 </varlistentry>
1468 <varlistentry><term></term>
1469 <listitem><para>
1470 </para></listitem>
1471 </varlistentry>
1472 </variablelist>
1473
1474 It reports about the finding of the following errors:
1475
1476 <variablelist>
1477 <varlistentry><term>Missing reverse mapping:</term>
1478 <listitem><para>
1479 A record with mapping A-&gt;B where there is no B-&gt;A. Default action
1480 in repair mode is to "fix" this by adding the reverse mapping.
1481 </para></listitem>
1482 </varlistentry>
1483
1484 <varlistentry><term>Invalid mapping:</term>
1485 <listitem><para>
1486 A record with mapping A-&gt;B where B-&gt;C. Default action
1487 is to "delete" this record.
1488 </para></listitem>
1489 </varlistentry>
1490
1491 <varlistentry><term>Missing or invalid HWM:</term>
1492 <listitem><para>
1493 A high water mark is not at least equal to the largest ID in the
1494 database. Default action is to "fix" this by setting it to the
1495 largest ID found +1.
1496 </para></listitem>
1497 </varlistentry>
1498
1499 <varlistentry><term>Invalid record:</term>
1500 <listitem><para>
1501 Something we failed to parse. Default action is to "edit" it
1502 in interactive and "delete" it in automatic mode.
1503 </para></listitem>
1504 </varlistentry>
1505</variablelist>
1506</para>
1507</refsect2>
1508
1509
1510<refsect2>
1511<title>USERSHARE</title>
1512
1513<para>Starting with version 3.0.23, a Samba server now supports the ability for
1514non-root users to add user defined shares to be exported using the "net usershare"
1515commands.
1516</para>
1517
1518<para>
1519To set this up, first set up your smb.conf by adding to the [global] section:
1520
1521usershare path = /usr/local/samba/lib/usershares
1522
1523Next create the directory /usr/local/samba/lib/usershares, change the owner to root and
1524set the group owner to the UNIX group who should have the ability to create usershares,
1525for example a group called "serverops".
1526
1527Set the permissions on /usr/local/samba/lib/usershares to 01770.
1528
1529(Owner and group all access, no access for others, plus the sticky bit,
1530which means that a file in that directory can be renamed or deleted only
1531by the owner of the file).
1532
1533Finally, tell smbd how many usershares you will allow by adding to the [global]
1534section of smb.conf a line such as :
1535
1536usershare max shares = 100.
1537
1538To allow 100 usershare definitions. Now, members of the UNIX group "serverops"
1539can create user defined shares on demand using the commands below.
1540</para>
1541
1542<para>The usershare commands are:
1543
1544<simplelist>
1545<member>net usershare add sharename path [comment [acl] [guest_ok=[y|n]]] - to add or change a user defined share.</member>
1546<member>net usershare delete sharename - to delete a user defined share.</member>
1547<member>net usershare info [-l|--long] [wildcard sharename] - to print info about a user defined share.</member>
1548<member>net usershare list [-l|--long] [wildcard sharename] - to list user defined shares.</member>
1549</simplelist>
1550
1551</para>
1552
1553<refsect3>
1554<title>USERSHARE ADD <replaceable>sharename</replaceable> <replaceable>path</replaceable> <replaceable>[comment]</replaceable> <replaceable>[acl]</replaceable> <replaceable>[guest_ok=[y|n]]</replaceable></title>
1555
1556<para>
1557Add or replace a new user defined share, with name "sharename".
1558</para>
1559
1560<para>
1561"path" specifies the absolute pathname on the system to be exported.
1562Restrictions may be put on this, see the global smb.conf parameters:
1563"usershare owner only", "usershare prefix allow list", and
1564"usershare prefix deny list".
1565</para>
1566
1567<para>
1568The optional "comment" parameter is the comment that will appear
1569on the share when browsed to by a client.
1570</para>
1571
1572<para>The optional "acl" field
1573specifies which users have read and write access to the entire share.
1574Note that guest connections are not allowed unless the smb.conf parameter
1575"usershare allow guests" has been set. The definition of a user
1576defined share acl is: "user:permission", where user is a valid
1577username on the system and permission can be "F", "R", or "D".
1578"F" stands for "full permissions", ie. read and write permissions.
1579"D" stands for "deny" for a user, ie. prevent this user from accessing
1580this share.
1581"R" stands for "read only", ie. only allow read access to this
1582share (no creation of new files or directories or writing to files).
1583</para>
1584
1585<para>
1586The default if no "acl" is given is "Everyone:R", which means any
1587authenticated user has read-only access.
1588</para>
1589
1590<para>
1591The optional "guest_ok" has the same effect as the parameter of the
1592same name in smb.conf, in that it allows guest access to this user
1593defined share. This parameter is only allowed if the global parameter
1594"usershare allow guests" has been set to true in the smb.conf.
1595</para>
1596
1597There is no separate command to modify an existing user defined share,
1598just use the "net usershare add [sharename]" command using the same
1599sharename as the one you wish to modify and specify the new options
1600you wish. The Samba smbd daemon notices user defined share modifications
1601at connect time so will see the change immediately, there is no need
1602to restart smbd on adding, deleting or changing a user defined share.
1603</refsect3>
1604
1605<refsect3>
1606<title>USERSHARE DELETE <replaceable>sharename</replaceable></title>
1607
1608<para>
1609Deletes the user defined share by name. The Samba smbd daemon
1610immediately notices this change, although it will not disconnect
1611any users currently connected to the deleted share.
1612</para>
1613
1614</refsect3>
1615
1616<refsect3>
1617<title>USERSHARE INFO <replaceable>[-l|--long]</replaceable> <replaceable>[wildcard sharename]</replaceable></title>
1618
1619<para>
1620Get info on user defined shares owned by the current user matching the given pattern, or all users.
1621</para>
1622
1623<para>
1624net usershare info on its own dumps out info on the user defined shares that were
1625created by the current user, or restricts them to share names that match the given
1626wildcard pattern ('*' matches one or more characters, '?' matches only one character).
1627If the '-l' or '--long' option is also given, it prints out info on user defined
1628shares created by other users.
1629</para>
1630
1631<para>
1632The information given about a share looks like:
1633
1634[foobar]
1635path=/home/jeremy
1636comment=testme
1637usershare_acl=Everyone:F
1638guest_ok=n
1639
1640And is a list of the current settings of the user defined share that can be
1641modified by the "net usershare add" command.
1642</para>
1643
1644</refsect3>
1645
1646<refsect3>
1647<title>USERSHARE LIST <replaceable>[-l|--long]</replaceable> <replaceable>wildcard sharename</replaceable></title>
1648
1649<para>
1650List all the user defined shares owned by the current user matching the given pattern, or all users.
1651</para>
1652
1653<para>
1654net usershare list on its own list out the names of the user defined shares that were
1655created by the current user, or restricts the list to share names that match the given
1656wildcard pattern ('*' matches one or more characters, '?' matches only one character).
1657If the '-l' or '--long' option is also given, it includes the names of user defined
1658shares created by other users.
1659</para>
1660
1661</refsect3>
1662
1663</refsect2>
1664
1665<refsect2>
1666<title>CONF</title>
1667
1668<para>Starting with version 3.2.0, a Samba server can be configured by data
1669stored in registry. This configuration data can be edited with the new "net
1670conf" commands.
1671</para>
1672
1673<para>
1674The deployment of this configuration data can be activated in two levels from the
1675<emphasis>smb.conf</emphasis> file: Share definitions from registry are
1676activated by setting <parameter>registry shares</parameter> to
1677<quote>yes</quote> in the [global] section and global configuration options are
1678activated by setting <smbconfoption name="include">registry</smbconfoption> in
1679the [global] section for a mixed configuration or by setting
1680<smbconfoption name="config backend">registry</smbconfoption> in the [global]
1681section for a registry-only configuration.
1682See the <citerefentry><refentrytitle>smb.conf</refentrytitle>
1683<manvolnum>5</manvolnum></citerefentry> manpage for details.
1684</para>
1685
1686<para>The conf commands are:
1687<simplelist>
1688<member>net conf list - Dump the complete configuration in smb.conf like
1689format.</member>
1690<member>net conf import - Import configuration from file in smb.conf
1691format.</member>
1692<member>net conf listshares - List the registry shares.</member>
1693<member>net conf drop - Delete the complete configuration from
1694registry.</member>
1695<member>net conf showshare - Show the definition of a registry share.</member>
1696<member>net conf addshare - Create a new registry share.</member>
1697<member>net conf delshare - Delete a registry share.</member>
1698<member>net conf setparm - Store a parameter.</member>
1699<member>net conf getparm - Retrieve the value of a parameter.</member>
1700<member>net conf delparm - Delete a parameter.</member>
1701<member>net conf getincludes - Show the includes of a share definition.</member>
1702<member>net conf setincludes - Set includes for a share.</member>
1703<member>net conf delincludes - Delete includes from a share definition.</member>
1704</simplelist>
1705</para>
1706
1707<refsect3>
1708<title>CONF LIST</title>
1709
1710<para>
1711Print the configuration data stored in the registry in a smb.conf-like format to
1712standard output.
1713</para>
1714</refsect3>
1715
1716<refsect3>
1717<title>CONF IMPORT <replaceable>[--test|-T]</replaceable> <replaceable>filename</replaceable> <replaceable>[section]</replaceable></title>
1718
1719<para>
1720This command imports configuration from a file in smb.conf format.
1721If a section encountered in the input file is present in registry,
1722its contents is replaced. Sections of registry configuration that have
1723no counterpart in the input file are not affected. If you want to delete these,
1724you will have to use the "net conf drop" or "net conf delshare" commands.
1725Optionally, a section may be specified to restrict the effect of the
1726import command to that specific section. A test mode is enabled by specifying
1727the parameter "-T" on the commandline. In test mode, no changes are made to the
1728registry, and the resulting configuration is printed to standard output instead.
1729</para>
1730</refsect3>
1731
1732<refsect3>
1733<title>CONF LISTSHARES</title>
1734
1735<para>
1736List the names of the shares defined in registry.
1737</para>
1738</refsect3>
1739
1740<refsect3>
1741<title>CONF DROP</title>
1742
1743<para>
1744Delete the complete configuration data from registry.
1745</para>
1746</refsect3>
1747
1748<refsect3>
1749<title>CONF SHOWSHARE <replaceable>sharename</replaceable></title>
1750
1751<para>
1752Show the definition of the share or section specified. It is valid to specify
1753"global" as sharename to retrieve the global configuration options from
1754registry.
1755</para>
1756</refsect3>
1757
1758<refsect3>
1759<title>CONF ADDSHARE <replaceable>sharename</replaceable> <replaceable>path</replaceable> [<replaceable>writeable={y|N}</replaceable> [<replaceable>guest_ok={y|N}</replaceable> [<replaceable>comment</replaceable>]]] </title>
1760
1761<para>Create a new share definition in registry.
1762The sharename and path have to be given. The share name may
1763<emphasis>not</emphasis> be "global". Optionally, values for the very
1764common options "writeable", "guest ok" and a "comment" may be specified.
1765The same result may be obtained by a sequence of "net conf setparm"
1766commands.
1767</para>
1768</refsect3>
1769
1770<refsect3>
1771<title>CONF DELSHARE <replaceable>sharename</replaceable></title>
1772
1773<para>
1774Delete a share definition from registry.
1775</para>
1776</refsect3>
1777
1778<refsect3>
1779<title>CONF SETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable> <replaceable>value</replaceable></title>
1780
1781<para>
1782Store a parameter in registry. The section may be global or a sharename.
1783The section is created if it does not exist yet.
1784</para>
1785</refsect3>
1786
1787<refsect3>
1788<title>CONF GETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
1789
1790<para>
1791Show a parameter stored in registry.
1792</para>
1793</refsect3>
1794
1795<refsect3>
1796<title>CONF DELPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
1797
1798<para>
1799Delete a parameter stored in registry.
1800</para>
1801</refsect3>
1802
1803<refsect3>
1804<title>CONF GETINCLUDES <replaceable>section</replaceable></title>
1805
1806<para>
1807Get the list of includes for the provided section (global or share).
1808</para>
1809
1810<para>
1811Note that due to the nature of the registry database and the nature of include directives,
1812the includes need special treatment: Parameters are stored in registry by the parameter
1813name as valuename, so there is only ever one instance of a parameter per share.
1814Also, a specific order like in a text file is not guaranteed. For all real
1815parameters, this is perfectly ok, but the include directive is rather a meta
1816parameter, for which, in the smb.conf text file, the place where it is specified
1817between the other parameters is very important. This can not be achieved by the
1818simple registry smbconf data model, so there is one ordered list of includes
1819per share, and this list is evaluated after all the parameters of the share.
1820</para>
1821
1822<para>
1823Further note that currently, only files can be included from registry
1824configuration. In the future, there will be the ability to include configuration
1825data from other registry keys.
1826</para>
1827</refsect3>
1828
1829<refsect3>
1830<title>CONF SETINCLUDES <replaceable>section</replaceable> [<replaceable>filename</replaceable>]+</title>
1831
1832<para>
1833Set the list of includes for the provided section (global or share) to the given
1834list of one or more filenames. The filenames may contain the usual smb.conf
1835macros like %I.
1836</para>
1837</refsect3>
1838
1839<refsect3>
1840<title>CONF DELINCLUDES <replaceable>section</replaceable></title>
1841
1842<para>
1843Delete the list of includes from the provided section (global or share).
1844</para>
1845</refsect3>
1846
1847</refsect2>
1848
1849<refsect2>
1850<title>REGISTRY</title>
1851<para>
1852Manipulate Samba's registry.
1853</para>
1854
1855<para>The registry commands are:
1856<simplelist>
1857<member>net registry enumerate - Enumerate registry keys and values.</member>
1858<member>net registry enumerate_recursive - Enumerate registry key and its subkeys.</member>
1859<member>net registry createkey - Create a new registry key.</member>
1860<member>net registry deletekey - Delete a registry key.</member>
1861<member>net registry deletekey_recursive - Delete a registry key with subkeys.</member>
1862<member>net registry getvalue - Print a registry value.</member>
1863<member>net registry getvalueraw - Print a registry value (raw format).</member>
1864<member>net registry setvalue - Set a new registry value.</member>
1865<member>net registry increment - Increment a DWORD registry value under a lock.
1866</member>
1867<member>net registry deletevalue - Delete a registry value.</member>
1868<member>net registry getsd - Get security descriptor.</member>
1869<member>net registry getsd_sdd1 - Get security descriptor in sddl format.
1870</member>
1871<member>net registry setsd_sdd1 - Set security descriptor from sddl format
1872string.</member>
1873<member>net registry import - Import a registration entries (.reg) file.
1874</member>
1875<member>net registry export - Export a registration entries (.reg) file.
1876</member>
1877<member>net registry convert - Convert a registration entries (.reg) file.
1878</member>
1879</simplelist>
1880</para>
1881
1882<refsect3>
1883 <title>REGISTRY ENUMERATE <replaceable>key</replaceable> </title>
1884 <para>Enumerate subkeys and values of <emphasis>key</emphasis>.
1885 </para>
1886</refsect3>
1887
1888<refsect3>
1889 <title>REGISTRY ENUMERATE_RECURSIVE <replaceable>key</replaceable> </title>
1890 <para>Enumerate values of <emphasis>key</emphasis> and its subkeys.
1891 </para>
1892</refsect3>
1893
1894<refsect3>
1895 <title>REGISTRY CREATEKEY <replaceable>key</replaceable> </title>
1896 <para>Create a new <emphasis>key</emphasis> if not yet existing.
1897 </para>
1898</refsect3>
1899
1900<refsect3>
1901 <title>REGISTRY DELETEKEY <replaceable>key</replaceable> </title>
1902 <para>Delete the given <emphasis>key</emphasis> and its
1903 values from the registry, if it has no subkeys.
1904 </para>
1905</refsect3>
1906
1907<refsect3>
1908 <title>REGISTRY DELETEKEY_RECURSIVE <replaceable>key</replaceable> </title>
1909 <para>Delete the given <emphasis>key</emphasis> and all of its
1910 subkeys and values from the registry.
1911 </para>
1912</refsect3>
1913
1914<refsect3>
1915 <title>REGISTRY GETVALUE <replaceable>key</replaceable> <!--
1916 --><replaceable>name</replaceable></title>
1917
1918 <para>Output type and actual value of the value <emphasis>name</emphasis>
1919 of the given <emphasis>key</emphasis>.
1920 </para>
1921</refsect3>
1922
1923<refsect3>
1924 <title>REGISTRY GETVALUERAW <replaceable>key</replaceable> <!--
1925 --><replaceable>name</replaceable></title>
1926 <para>Output the actual value of the value <emphasis>name</emphasis>
1927 of the given <emphasis>key</emphasis>.
1928 </para>
1929</refsect3>
1930
1931<refsect3>
1932 <title>REGISTRY SETVALUE <replaceable>key</replaceable> <!--
1933 --><replaceable>name</replaceable> <replaceable>type</replaceable> <!--
1934 --><replaceable>value</replaceable> ...<!--
1935 --></title>
1936
1937 <para>Set the value <emphasis>name</emphasis>
1938 of an existing <emphasis>key</emphasis>.
1939 <emphasis>type</emphasis> may be one of
1940 <emphasis>sz</emphasis>, <emphasis>multi_sz</emphasis> or
1941 <emphasis>dword</emphasis>.
1942 In case of <emphasis>multi_sz</emphasis> <replaceable>value</replaceable> may
1943 be given multiple times.
1944 </para>
1945</refsect3>
1946
1947<refsect3>
1948 <title>REGISTRY INCREMENT <replaceable>key</replaceable> <!--
1949 --><replaceable>name</replaceable> <replaceable>[inc]</replaceable><!--
1950 --></title>
1951
1952 <para>Increment the DWORD value <emphasis>name</emphasis>
1953 of <emphasis>key</emphasis> by <replaceable>inc</replaceable>
1954 while holding a g_lock.
1955 <emphasis>inc</emphasis> defaults to 1.
1956 </para>
1957</refsect3>
1958
1959<refsect3>
1960 <title>REGISTRY DELETEVALUE <replaceable>key</replaceable> <!--
1961 --><replaceable>name</replaceable></title>
1962
1963 <para>Delete the value <emphasis>name</emphasis>
1964 of the given <emphasis>key</emphasis>.
1965 </para>
1966</refsect3>
1967
1968<refsect3>
1969 <title>REGISTRY GETSD <replaceable>key</replaceable></title>
1970
1971 <para>Get the security descriptor of the given <emphasis>key</emphasis>.
1972 </para>
1973</refsect3>
1974
1975<refsect3>
1976 <title>REGISTRY GETSD_SDDL <replaceable>key</replaceable></title>
1977
1978 <para>Get the security descriptor of the given <emphasis>key</emphasis> as a
1979 Security Descriptor Definition Language (SDDL) string.
1980 </para>
1981</refsect3>
1982
1983<refsect3>
1984 <title>REGISTRY SETSD_SDDL <replaceable>key</replaceable><!--
1985 --><replaceable>sd</replaceable></title>
1986
1987 <para>Set the security descriptor of the given <emphasis>key</emphasis> from a
1988 Security Descriptor Definition Language (SDDL) string <emphasis>sd</emphasis>.
1989 </para>
1990</refsect3>
1991
1992<refsect3>
1993 <title>REGISTRY IMPORT <replaceable>file</replaceable><!--
1994 --><replaceable>[opt]</replaceable></title>
1995
1996 <para>Import a registration entries (.reg) <emphasis>file</emphasis>.
1997 </para>
1998</refsect3>
1999
2000<refsect3>
2001 <title>REGISTRY EXPORT <replaceable>key</replaceable><!--
2002 --><replaceable>file</replaceable><!--
2003 --><replaceable>[opt]</replaceable></title>
2004
2005 <para>Export a <emphasis>key</emphasis> to a registration entries (.reg)
2006 <emphasis>file</emphasis>.
2007 </para>
2008</refsect3>
2009
2010<refsect3>
2011 <title>REGISTRY CONVERT <replaceable>in</replaceable> <!--
2012 --><replaceable>out</replaceable> <!--
2013 --><replaceable>[[inopt] outopt]</replaceable></title>
2014
2015 <para>Convert a registration entries (.reg) file <emphasis>in</emphasis>.
2016 </para>
2017</refsect3>
2018
2019
2020</refsect2>
2021
2022<refsect2>
2023<title>EVENTLOG</title>
2024
2025<para>Starting with version 3.4.0 net can read, dump, import and export native
2026win32 eventlog files (usually *.evt). evt files are used by the native Windows eventviewer tools.
2027</para>
2028
2029<para>
2030The import and export of evt files can only succeed when <parameter>eventlog list</parameter> is used in
2031<emphasis>smb.conf</emphasis> file.
2032See the <citerefentry><refentrytitle>smb.conf</refentrytitle> <manvolnum>5</manvolnum></citerefentry> manpage for details.
2033</para>
2034
2035<para>The eventlog commands are:
2036<simplelist>
2037<member>net eventlog dump - Dump a eventlog *.evt file on the screen.</member>
2038<member>net eventlog import - Import a eventlog *.evt into the samba internal
2039tdb based representation of eventlogs.</member>
2040<member>net eventlog export - Export the samba internal tdb based representation
2041of eventlogs into an eventlog *.evt file.</member>
2042</simplelist>
2043</para>
2044
2045<refsect3>
2046<title>EVENTLOG DUMP <replaceable>filename</replaceable></title>
2047
2048<para>
2049Prints a eventlog *.evt file to standard output.
2050</para>
2051</refsect3>
2052
2053<refsect3>
2054<title>EVENTLOG IMPORT <replaceable>filename</replaceable> <replaceable>eventlog</replaceable></title>
2055
2056<para>
2057Imports a eventlog *.evt file defined by <replaceable>filename</replaceable> into the
2058samba internal tdb representation of eventlog defined by <replaceable>eventlog</replaceable>.
2059<replaceable>eventlog</replaceable> needs to part of the <parameter>eventlog list</parameter>
2060defined in smb.conf.
2061See the <citerefentry><refentrytitle>smb.conf</refentrytitle> <manvolnum>5</manvolnum></citerefentry> manpage for details.
2062</para>
2063
2064</refsect3>
2065
2066<refsect3>
2067<title>EVENTLOG EXPORT <replaceable>filename</replaceable> <replaceable>eventlog</replaceable></title>
2068
2069<para>
2070Exports the samba internal tdb representation of eventlog defined by <replaceable>eventlog</replaceable>
2071to a eventlog *.evt file defined by <replaceable>filename</replaceable>.
2072<replaceable>eventlog</replaceable> needs to part of the <parameter>eventlog list</parameter>
2073defined in smb.conf.
2074See the <citerefentry><refentrytitle>smb.conf</refentrytitle> <manvolnum>5</manvolnum></citerefentry> manpage for details.
2075</para>
2076
2077</refsect3>
2078
2079</refsect2>
2080
2081<refsect2>
2082<title>DOM</title>
2083
2084<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.
2085</para>
2086<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.
2087</para>
2088
2089<para>The client side support for remote join is implemented in the net dom commands which are:
2090<simplelist>
2091<member>net dom join - Join a remote computer into a domain.</member>
2092<member>net dom unjoin - Unjoin a remote computer from a domain.</member>
2093<member>net dom renamecomputer - Renames a remote computer joined to a domain.</member>
2094</simplelist>
2095</para>
2096
2097<refsect3>
2098<title>DOM JOIN <replaceable>domain=DOMAIN</replaceable> <replaceable>ou=OU</replaceable> <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
2099
2100<para>
2101Joins a computer into a domain. This command supports the following additional parameters:
2102</para>
2103
2104<itemizedlist>
2105
2106<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>
2107
2108<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>
2109
2110<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>
2111
2112<listitem><para><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</para></listitem>
2113
2114<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>
2115
2116</itemizedlist>
2117
2118<para>
2119Note 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.
2120</para>
2121<para>
2122 Example:
2123 net dom join -S xp -U XP\\administrator%secret domain=MYDOM account=MYDOM\\administrator password=topsecret reboot.
2124</para>
2125<para>
2126This 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.
2127</para>
2128
2129</refsect3>
2130
2131<refsect3>
2132<title>DOM UNJOIN <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
2133
2134<para>
2135Unjoins a computer from a domain. This command supports the following additional parameters:
2136</para>
2137
2138<itemizedlist>
2139
2140<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>
2141
2142<listitem><para><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</para></listitem>
2143
2144<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>
2145
2146</itemizedlist>
2147
2148<para>
2149Note 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.
2150</para>
2151<para>
2152 Example:
2153 net dom unjoin -S xp -U XP\\administrator%secret account=MYDOM\\administrator password=topsecret reboot.
2154</para>
2155<para>
2156This 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.
2157</para>
2158
2159</refsect3>
2160
2161<refsect3>
2162<title>DOM RENAMECOMPUTER <replaceable>newname=NEWNAME</replaceable> <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
2163
2164<para>
2165Renames a computer that is joined to a domain. This command supports the following additional parameters:
2166</para>
2167
2168<itemizedlist>
2169
2170<listitem><para><replaceable>NEWNAME</replaceable> defines the new name of the machine in the domain.</para></listitem>
2171
2172<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>
2173
2174<listitem><para><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</para></listitem>
2175
2176<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>
2177
2178</itemizedlist>
2179
2180<para>
2181Note 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.
2182</para>
2183<para>
2184 Example:
2185 net dom renamecomputer -S xp -U XP\\administrator%secret newname=XPNEW account=MYDOM\\administrator password=topsecret reboot.
2186</para>
2187<para>
2188This 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.
2189</para>
2190
2191</refsect3>
2192
2193</refsect2>
2194
2195<refsect2>
2196<title>G_LOCK</title>
2197
2198<para>Manage global locks.</para>
2199
2200<refsect3>
2201<title>G_LOCK DO <replaceable>lockname</replaceable> <replaceable>timeout</replaceable> <replaceable>command</replaceable></title>
2202
2203<para>
2204Execute a shell command under a global lock. This might be useful to define the
2205order in which several shell commands will be executed. The locking information
2206is stored in a file called <filename>g_lock.tdb</filename>. In setups with CTDB
2207running, the locking information will be available on all cluster nodes.
2208</para>
2209
2210<itemizedlist>
2211<listitem><para><replaceable>LOCKNAME</replaceable> defines the name of the global lock.</para></listitem>
2212<listitem><para><replaceable>TIMEOUT</replaceable> defines the timeout.</para></listitem>
2213<listitem><para><replaceable>COMMAND</replaceable> defines the shell command to execute.</para></listitem>
2214</itemizedlist>
2215</refsect3>
2216
2217<refsect3>
2218<title>G_LOCK LOCKS</title>
2219
2220<para>
2221Print a list of all currently existing locknames.
2222</para>
2223</refsect3>
2224
2225<refsect3>
2226<title>G_LOCK DUMP <replaceable>lockname</replaceable></title>
2227
2228<para>
2229Dump the locking table of a certain global lock.
2230</para>
2231</refsect3>
2232
2233</refsect2>
2234
2235<refsect2>
2236<title>HELP [COMMAND]</title>
2237
2238<para>Gives usage information for the specified command.</para>
2239
2240</refsect2>
2241
2242</refsect1>
2243
2244<refsect1>
2245 <title>VERSION</title>
2246
2247 <para>This man page is complete for version 3 of the Samba
2248 suite.</para>
2249</refsect1>
2250
2251<refsect1>
2252 <title>AUTHOR</title>
2253
2254 <para>The original Samba software and related utilities
2255 were created by Andrew Tridgell. Samba is now developed
2256 by the Samba Team as an Open Source project similar
2257 to the way the Linux kernel is developed.</para>
2258
2259 <para>The net manpage was written by Jelmer Vernooij.</para>
2260
2261</refsect1>
2262
2263</refentry>
Note: See TracBrowser for help on using the repository browser.