source: vendor/current/docs/manpages/net.8

Last change on this file was 989, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.7

File size: 54.7 KB
Line 
1'\" t
2.\" Title: net
3.\" Author: [see the "AUTHOR" section]
4.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
5.\" Date: 10/25/2016
6.\" Manual: System Administration tools
7.\" Source: Samba 4.4
8.\" Language: English
9.\"
10.TH "NET" "8" "10/25/2016" "Samba 4\&.4" "System Administration tools"
11.\" -----------------------------------------------------------------
12.\" * Define some portability stuff
13.\" -----------------------------------------------------------------
14.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15.\" http://bugs.debian.org/507673
16.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18.ie \n(.g .ds Aq \(aq
19.el .ds Aq '
20.\" -----------------------------------------------------------------
21.\" * set default formatting
22.\" -----------------------------------------------------------------
23.\" disable hyphenation
24.nh
25.\" disable justification (adjust text to left margin only)
26.ad l
27.\" -----------------------------------------------------------------
28.\" * MAIN CONTENT STARTS HERE *
29.\" -----------------------------------------------------------------
30.SH "NAME"
31net \- Tool for administration of Samba and remote CIFS servers\&.
32.SH "SYNOPSIS"
33.HP \w'\ 'u
34net {<ads|rap|rpc>} [\-h|\-\-help] [\-w|\-\-workgroup\ workgroup] [\-W|\-\-myworkgroup\ myworkgroup] [\-U|\-\-user\ user] [\-I|\-\-ipaddress\ ip\-address] [\-p|\-\-port\ port] [\-n\ myname] [\-s\ conffile] [\-S|\-\-server\ server] [\-l|\-\-long] [\-v|\-\-verbose] [\-f|\-\-force] [\-P|\-\-machine\-pass] [\-d\ debuglevel] [\-V] [\-\-request\-timeout\ seconds] [\-t|\-\-timeout\ seconds] [\-i|\-\-stdin] [\-\-tallocreport]
35.SH "DESCRIPTION"
36.PP
37This tool is part of the
38\fBsamba\fR(7)
39suite\&.
40.PP
41The Samba net utility is meant to work just like the net utility available for windows and DOS\&. The first argument should be used to specify the protocol to use when executing a certain command\&. ADS is used for ActiveDirectory, RAP is using for old (Win9x/NT3) clients and RPC can be used for NT4 and Windows 2000\&. If this argument is omitted, net will try to determine it automatically\&. Not all commands are available on all protocols\&.
42.SH "OPTIONS"
43.PP
44\-w|\-\-workgroup target\-workgroup
45.RS 4
46Sets target workgroup or domain\&. You have to specify either this option or the IP address or the name of a server\&.
47.RE
48.PP
49\-W|\-\-myworkgroup workgroup
50.RS 4
51Sets client workgroup or domain
52.RE
53.PP
54\-U|\-\-user user
55.RS 4
56User name to use
57.RE
58.PP
59\-I|\-\-ipaddress ip\-address
60.RS 4
61IP address of target server to use\&. You have to specify either this option or a target workgroup or a target server\&.
62.RE
63.PP
64\-p|\-\-port port
65.RS 4
66Port on the target server to connect to (usually 139 or 445)\&. Defaults to trying 445 first, then 139\&.
67.RE
68.PP
69\-S|\-\-server server
70.RS 4
71Name of target server\&. You should specify either this option or a target workgroup or a target IP address\&.
72.RE
73.PP
74\-l|\-\-long
75.RS 4
76When listing data, give more information on each item\&.
77.RE
78.PP
79\-v|\-\-verbose
80.RS 4
81When listing data, give more verbose information on each item\&.
82.RE
83.PP
84\-f|\-\-force
85.RS 4
86Enforcing a net command\&.
87.RE
88.PP
89\-P|\-\-machine\-pass
90.RS 4
91Make queries to the external server using the machine account of the local server\&.
92.RE
93.PP
94\-\-request\-timeout 30
95.RS 4
96Let client requests timeout after 30 seconds the default is 10 seconds\&.
97.RE
98.PP
99\-t|\-\-timeout 30
100.RS 4
101Set timeout for client operations to 30 seconds\&.
102.RE
103.PP
104\-\-use\-ccache
105.RS 4
106Try to use the credentials cached by winbind\&.
107.RE
108.PP
109\-i|\-\-stdin
110.RS 4
111Take input for net commands from standard input\&.
112.RE
113.PP
114\-\-tallocreport
115.RS 4
116Generate a talloc report while processing a net command\&.
117.RE
118.PP
119\-T|\-\-test
120.RS 4
121Only test command sequence, dry\-run\&.
122.RE
123.PP
124\-F|\-\-flags FLAGS
125.RS 4
126Pass down integer flags to a net subcommand\&.
127.RE
128.PP
129\-C|\-\-comment COMMENT
130.RS 4
131Pass down a comment string to a net subcommand\&.
132.RE
133.PP
134\-n|\-\-myname MYNAME
135.RS 4
136Use MYNAME as a requester name for a net subcommand\&.
137.RE
138.PP
139\-c|\-\-container CONTAINER
140.RS 4
141Use a specific AD container for net ads operations\&.
142.RE
143.PP
144\-M|\-\-maxusers MAXUSERS
145.RS 4
146Fill in the maxusers field in net rpc share operations\&.
147.RE
148.PP
149\-r|\-\-reboot
150.RS 4
151Reboot a remote machine after a command has been successfully executed (e\&.g\&. in remote join operations)\&.
152.RE
153.PP
154\-\-force\-full\-repl
155.RS 4
156When calling "net rpc vampire keytab" this option enforces a full re\-creation of the generated keytab file\&.
157.RE
158.PP
159\-\-single\-obj\-repl
160.RS 4
161When calling "net rpc vampire keytab" this option allows one to replicate just a single object to the generated keytab file\&.
162.RE
163.PP
164\-\-clean\-old\-entries
165.RS 4
166When calling "net rpc vampire keytab" this option allows one to cleanup old entries from the generated keytab file\&.
167.RE
168.PP
169\-\-db
170.RS 4
171Define dbfile for "net idmap" commands\&.
172.RE
173.PP
174\-\-lock
175.RS 4
176Activates locking of the dbfile for "net idmap check" command\&.
177.RE
178.PP
179\-a|\-\-auto
180.RS 4
181Activates noninteractive mode in "net idmap check"\&.
182.RE
183.PP
184\-\-repair
185.RS 4
186Activates repair mode in "net idmap check"\&.
187.RE
188.PP
189\-\-acls
190.RS 4
191Includes ACLs to be copied in "net rpc share migrate"\&.
192.RE
193.PP
194\-\-attrs
195.RS 4
196Includes file attributes to be copied in "net rpc share migrate"\&.
197.RE
198.PP
199\-\-timestamps
200.RS 4
201Includes timestamps to be copied in "net rpc share migrate"\&.
202.RE
203.PP
204\-X|\-\-exclude DIRECTORY
205.RS 4
206Allows one to exclude directories when copying with "net rpc share migrate"\&.
207.RE
208.PP
209\-\-destination SERVERNAME
210.RS 4
211Defines the target servername of migration process (defaults to localhost)\&.
212.RE
213.PP
214\-L|\-\-local
215.RS 4
216Sets the type of group mapping to local (used in "net groupmap set")\&.
217.RE
218.PP
219\-D|\-\-domain
220.RS 4
221Sets the type of group mapping to domain (used in "net groupmap set")\&.
222.RE
223.PP
224\-N|\-\-ntname NTNAME
225.RS 4
226Sets the ntname of a group mapping (used in "net groupmap set")\&.
227.RE
228.PP
229\-R|\-\-rid RID
230.RS 4
231Sets the rid of a group mapping (used in "net groupmap set")\&.
232.RE
233.PP
234\-\-reg\-version REG_VERSION
235.RS 4
236Assume database version {n|1,2,3} (used in "net registry check")\&.
237.RE
238.PP
239\-o|\-\-output FILENAME
240.RS 4
241Output database file (used in "net registry check")\&.
242.RE
243.PP
244\-\-wipe
245.RS 4
246Create a new database from scratch (used in "net registry check")\&.
247.RE
248.PP
249\-\-precheck PRECHECK_DB_FILENAME
250.RS 4
251Defines filename for database prechecking (used in "net registry import")\&.
252.RE
253.PP
254\-\-no\-dns\-updates
255.RS 4
256Do not perform DNS updates as part of "net ads join"\&.
257.RE
258.SH "COMMANDS"
259.SS "CHANGESECRETPW"
260.PP
261This command allows the Samba machine account password to be set from an external application to a machine account password that has already been stored in Active Directory\&. DO NOT USE this command unless you know exactly what you are doing\&. The use of this command requires that the force flag (\-f) be used also\&. There will be NO command prompt\&. Whatever information is piped into stdin, either by typing at the command line or otherwise, will be stored as the literal machine password\&. Do NOT use this without care and attention as it will overwrite a legitimate machine password without warning\&. YOU HAVE BEEN WARNED\&.
262.SS "TIME"
263.PP
264The
265NET TIME
266command allows you to view the time on a remote server or synchronise the time on the local server with the time on the remote server\&.
267.SS "TIME"
268.PP
269Without any options, the
270NET TIME
271command displays the time on the remote server\&. The remote server must be specified with the \-S option\&.
272.SS "TIME SYSTEM"
273.PP
274Displays the time on the remote server in a format ready for
275/bin/date\&. The remote server must be specified with the \-S option\&.
276.SS "TIME SET"
277.PP
278Tries to set the date and time of the local server to that on the remote server using
279/bin/date\&. The remote server must be specified with the \-S option\&.
280.SS "TIME ZONE"
281.PP
282Displays the timezone in hours from GMT on the remote server\&. The remote server must be specified with the \-S option\&.
283.SS "[RPC|ADS] JOIN [TYPE] [\-\-no\-dns\-updates] [\-U username[%password]] [createupn=UPN] [createcomputer=OU] [machinepass=PASS] [osName=string osVer=string] [options]"
284.PP
285Join a domain\&. If the account already exists on the server, and [TYPE] is MEMBER, the machine will attempt to join automatically\&. (Assuming that the machine has been created in server manager) Otherwise, a password will be prompted for, and a new account may be created\&.
286.PP
287[TYPE] may be PDC, BDC or MEMBER to specify the type of server joining the domain\&.
288.PP
289[UPN] (ADS only) set the principalname attribute during the join\&. The default format is host/netbiosname@REALM\&.
290.PP
291[OU] (ADS only) Precreate the computer account in a specific OU\&. The OU string reads from top to bottom without RDNs, and is delimited by a \*(Aq/\*(Aq\&. Please note that \*(Aq\e\*(Aq is used for escape by both the shell and ldap, so it may need to be doubled or quadrupled to pass through, and it is not used as a delimiter\&.
292.PP
293[PASS] (ADS only) Set a specific password on the computer account being created by the join\&.
294.PP
295[osName=string osVer=String] (ADS only) Set the operatingSystem and operatingSystemVersion attribute during the join\&. Both parameters must be specified for either to take effect\&.
296.SS "[RPC] OLDJOIN [options]"
297.PP
298Join a domain\&. Use the OLDJOIN option to join the domain using the old style of domain joining \- you need to create a trust account in server manager first\&.
299.SS "[RPC|ADS] USER"
300.SS "[RPC|ADS] USER"
301.PP
302List all users
303.SS "[RPC|ADS] USER DELETE target"
304.PP
305Delete specified user
306.SS "[RPC|ADS] USER INFO target"
307.PP
308List the domain groups of the specified user\&.
309.SS "[RPC|ADS] USER RENAME oldname newname"
310.PP
311Rename specified user\&.
312.SS "[RPC|ADS] USER ADD name [password] [-F user flags] [-C comment]"
313.PP
314Add specified user\&.
315.SS "[RPC|ADS] GROUP"
316.SS "[RPC|ADS] GROUP [misc options] [targets]"
317.PP
318List user groups\&.
319.SS "[RPC|ADS] GROUP DELETE name [misc. options]"
320.PP
321Delete specified group\&.
322.SS "[RPC|ADS] GROUP ADD name [-C comment]"
323.PP
324Create specified group\&.
325.SS "[RAP|RPC] SHARE"
326.SS "[RAP|RPC] SHARE [misc. options] [targets]"
327.PP
328Enumerates all exported resources (network shares) on target server\&.
329.SS "[RAP|RPC] SHARE ADD name=serverpath [-C comment] [-M maxusers] [targets]"
330.PP
331Adds a share from a server (makes the export active)\&. Maxusers specifies the number of users that can be connected to the share simultaneously\&.
332.SS "SHARE DELETE sharename"
333.PP
334Delete specified share\&.
335.SS "[RPC|RAP] FILE"
336.SS "[RPC|RAP] FILE"
337.PP
338List all open files on remote server\&.
339.SS "[RPC|RAP] FILE CLOSE fileid"
340.PP
341Close file with specified
342\fIfileid\fR
343on remote server\&.
344.SS "[RPC|RAP] FILE INFO fileid"
345.PP
346Print information on specified
347\fIfileid\fR\&. Currently listed are: file\-id, username, locks, path, permissions\&.
348.SS "[RAP|RPC] FILE USER user"
349.PP
350List files opened by specified
351\fIuser\fR\&. Please note that
352net rap file user
353does not work against Samba servers\&.
354.SS "SESSION"
355.SS "RAP SESSION"
356.PP
357Without any other options, SESSION enumerates all active SMB/CIFS sessions on the target server\&.
358.SS "RAP SESSION DELETE|CLOSE CLIENT_NAME"
359.PP
360Close the specified sessions\&.
361.SS "RAP SESSION INFO CLIENT_NAME"
362.PP
363Give a list with all the open files in specified session\&.
364.SS "RAP SERVER \fIDOMAIN\fR"
365.PP
366List all servers in specified domain or workgroup\&. Defaults to local domain\&.
367.SS "RAP DOMAIN"
368.PP
369Lists all domains and workgroups visible on the current network\&.
370.SS "RAP PRINTQ"
371.SS "RAP PRINTQ INFO QUEUE_NAME"
372.PP
373Lists the specified print queue and print jobs on the server\&. If the
374\fIQUEUE_NAME\fR
375is omitted, all queues are listed\&.
376.SS "RAP PRINTQ DELETE JOBID"
377.PP
378Delete job with specified id\&.
379.SS "RAP VALIDATE \fIuser\fR [\fIpassword\fR]"
380.PP
381Validate whether the specified user can log in to the remote server\&. If the password is not specified on the commandline, it will be prompted\&.
382.SS "RAP GROUPMEMBER"
383.SS "RAP GROUPMEMBER LIST GROUP"
384.PP
385List all members of the specified group\&.
386.SS "RAP GROUPMEMBER DELETE GROUP USER"
387.PP
388Delete member from group\&.
389.SS "RAP GROUPMEMBER ADD GROUP USER"
390.PP
391Add member to group\&.
392.SS "RAP ADMIN \fIcommand\fR"
393.PP
394Execute the specified
395\fIcommand\fR
396on the remote server\&. Only works with OS/2 servers\&.
397.SS "RAP SERVICE"
398.SS "RAP SERVICE START NAME [arguments...]"
399.PP
400Start the specified service on the remote server\&. Not implemented yet\&.
401.SS "RAP SERVICE STOP"
402.PP
403Stop the specified service on the remote server\&.
404.SS "RAP PASSWORD \fIUSER\fR \fIOLDPASS\fR \fINEWPASS\fR"
405.PP
406Change password of
407\fIUSER\fR
408from
409\fIOLDPASS\fR
410to
411\fINEWPASS\fR\&.
412.SS "LOOKUP"
413.SS "LOOKUP HOST HOSTNAME [TYPE]"
414.PP
415Lookup the IP address of the given host with the specified type (netbios suffix)\&. The type defaults to 0x20 (workstation)\&.
416.SS "LOOKUP LDAP [DOMAIN]"
417.PP
418Give IP address of LDAP server of specified
419\fIDOMAIN\fR\&. Defaults to local domain\&.
420.SS "LOOKUP KDC [REALM]"
421.PP
422Give IP address of KDC for the specified
423\fIREALM\fR\&. Defaults to local realm\&.
424.SS "LOOKUP DC [DOMAIN]"
425.PP
426Give IP\*(Aqs of Domain Controllers for specified
427\fI DOMAIN\fR\&. Defaults to local domain\&.
428.SS "LOOKUP MASTER DOMAIN"
429.PP
430Give IP of master browser for specified
431\fIDOMAIN\fR
432or workgroup\&. Defaults to local domain\&.
433.SS "CACHE"
434.PP
435Samba uses a general caching interface called \*(Aqgencache\*(Aq\&. It can be controlled using \*(AqNET CACHE\*(Aq\&.
436.PP
437All the timeout parameters support the suffixes:
438.RS 4
439s \- Seconds
440.RE
441.RS 4
442m \- Minutes
443.RE
444.RS 4
445h \- Hours
446.RE
447.RS 4
448d \- Days
449.RE
450.RS 4
451w \- Weeks
452.RE
453.SS "CACHE ADD key data time-out"
454.PP
455Add specified key+data to the cache with the given timeout\&.
456.SS "CACHE DEL key"
457.PP
458Delete key from the cache\&.
459.SS "CACHE SET key data time-out"
460.PP
461Update data of existing cache entry\&.
462.SS "CACHE SEARCH PATTERN"
463.PP
464Search for the specified pattern in the cache data\&.
465.SS "CACHE LIST"
466.PP
467List all current items in the cache\&.
468.SS "CACHE FLUSH"
469.PP
470Remove all the current items from the cache\&.
471.SS "GETLOCALSID [DOMAIN]"
472.PP
473Prints the SID of the specified domain, or if the parameter is omitted, the SID of the local server\&.
474.SS "SETLOCALSID S\-1\-5\-21\-x\-y\-z"
475.PP
476Sets SID for the local server to the specified SID\&.
477.SS "GETDOMAINSID"
478.PP
479Prints the local machine SID and the SID of the current domain\&.
480.SS "SETDOMAINSID"
481.PP
482Sets the SID of the current domain\&.
483.SS "GROUPMAP"
484.PP
485Manage the mappings between Windows group SIDs and UNIX groups\&. Common options include:
486.sp
487.RS 4
488.ie n \{\
489\h'-04'\(bu\h'+03'\c
490.\}
491.el \{\
492.sp -1
493.IP \(bu 2.3
494.\}
495unixgroup \- Name of the UNIX group
496.RE
497.sp
498.RS 4
499.ie n \{\
500\h'-04'\(bu\h'+03'\c
501.\}
502.el \{\
503.sp -1
504.IP \(bu 2.3
505.\}
506ntgroup \- Name of the Windows NT group (must be resolvable to a SID
507.RE
508.sp
509.RS 4
510.ie n \{\
511\h'-04'\(bu\h'+03'\c
512.\}
513.el \{\
514.sp -1
515.IP \(bu 2.3
516.\}
517rid \- Unsigned 32\-bit integer
518.RE
519.sp
520.RS 4
521.ie n \{\
522\h'-04'\(bu\h'+03'\c
523.\}
524.el \{\
525.sp -1
526.IP \(bu 2.3
527.\}
528sid \- Full SID in the form of "S\-1\-\&.\&.\&."
529.RE
530.sp
531.RS 4
532.ie n \{\
533\h'-04'\(bu\h'+03'\c
534.\}
535.el \{\
536.sp -1
537.IP \(bu 2.3
538.\}
539type \- Type of the group; either \*(Aqdomain\*(Aq, \*(Aqlocal\*(Aq, or \*(Aqbuiltin\*(Aq
540.RE
541.sp
542.RS 4
543.ie n \{\
544\h'-04'\(bu\h'+03'\c
545.\}
546.el \{\
547.sp -1
548.IP \(bu 2.3
549.\}
550comment \- Freeform text description of the group
551.RE
552.sp
553.RE
554.SS "GROUPMAP ADD"
555.PP
556Add a new group mapping entry:
557.sp
558.if n \{\
559.RS 4
560.\}
561.nf
562net groupmap add {rid=int|sid=string} unixgroup=string \e
563 [type={domain|local}] [ntgroup=string] [comment=string]
564.fi
565.if n \{\
566.RE
567.\}
568.sp
569
570.SS "GROUPMAP DELETE"
571.PP
572Delete a group mapping entry\&. If more than one group name matches, the first entry found is deleted\&.
573.PP
574net groupmap delete {ntgroup=string|sid=SID}
575.SS "GROUPMAP MODIFY"
576.PP
577Update an existing group entry\&.
578.PP
579.if n \{\
580.RS 4
581.\}
582.nf
583net groupmap modify {ntgroup=string|sid=SID} [unixgroup=string] \e
584 [comment=string] [type={domain|local}]
585.fi
586.if n \{\
587.RE
588.\}
589.sp
590
591.SS "GROUPMAP LIST"
592.PP
593List existing group mapping entries\&.
594.PP
595net groupmap list [verbose] [ntgroup=string] [sid=SID]
596.SS "MAXRID"
597.PP
598Prints out the highest RID currently in use on the local server (by the active \*(Aqpassdb backend\*(Aq)\&.
599.SS "RPC INFO"
600.PP
601Print information about the domain of the remote server, such as domain name, domain sid and number of users and groups\&.
602.SS "[RPC|ADS] TESTJOIN"
603.PP
604Check whether participation in a domain is still valid\&.
605.SS "[RPC|ADS] CHANGETRUSTPW"
606.PP
607Force change of domain trust password\&.
608.SS "RPC TRUSTDOM"
609.SS "RPC TRUSTDOM ADD DOMAIN"
610.PP
611Add a interdomain trust account for
612\fIDOMAIN\fR\&. This is in fact a Samba account named
613\fIDOMAIN$\fR
614with the account flag
615\fB\*(AqI\*(Aq\fR
616(interdomain trust account)\&. This is required for incoming trusts to work\&. It makes Samba be a trusted domain of the foreign (trusting) domain\&. Users of the Samba domain will be made available in the foreign domain\&. If the command is used against localhost it has the same effect as
617smbpasswd \-a \-i DOMAIN\&. Please note that both commands expect a appropriate UNIX account\&.
618.SS "RPC TRUSTDOM DEL DOMAIN"
619.PP
620Remove interdomain trust account for
621\fIDOMAIN\fR\&. If it is used against localhost it has the same effect as
622smbpasswd \-x DOMAIN$\&.
623.SS "RPC TRUSTDOM ESTABLISH DOMAIN"
624.PP
625Establish a trust relationship to a trusted domain\&. Interdomain account must already be created on the remote PDC\&. This is required for outgoing trusts to work\&. It makes Samba be a trusting domain of a foreign (trusted) domain\&. Users of the foreign domain will be made available in our domain\&. You\*(Aqll need winbind and a working idmap config to make them appear in your system\&.
626.SS "RPC TRUSTDOM REVOKE DOMAIN"
627.PP
628Abandon relationship to trusted domain
629.SS "RPC TRUSTDOM LIST"
630.PP
631List all interdomain trust relationships\&.
632.SS "RPC TRUST"
633.SS "RPC TRUST CREATE"
634.PP
635Create a trust object by calling lsaCreateTrustedDomainEx2\&. The can be done on a single server or on two servers at once with the possibility to use a random trust password\&.
636.PP
637\fBOptions:\fR
638.PP
639otherserver
640.RS 4
641Domain controller of the second domain
642.RE
643.PP
644otheruser
645.RS 4
646Admin user in the second domain
647.RE
648.PP
649otherdomainsid
650.RS 4
651SID of the second domain
652.RE
653.PP
654other_netbios_domain
655.RS 4
656NetBIOS (short) name of the second domain
657.RE
658.PP
659otherdomain
660.RS 4
661DNS (full) name of the second domain
662.RE
663.PP
664trustpw
665.RS 4
666Trust password
667.RE
668.PP
669\fBExamples:\fR
670.PP
671Create a trust object on srv1\&.dom1\&.dom for the domain dom2
672.RS 4
673.sp
674.if n \{\
675.RS 4
676.\}
677.nf
678net rpc trust create \e
679 otherdomainsid=S\-x\-x\-xx\-xxxxxxxxxx\-xxxxxxxxxx\-xxxxxxxxx \e
680 other_netbios_domain=dom2 \e
681 otherdomain=dom2\&.dom \e
682 trustpw=12345678 \e
683 \-S srv1\&.dom1\&.dom
684.fi
685.if n \{\
686.RE
687.\}
688.RE
689.PP
690Create a trust relationship between dom1 and dom2
691.RS 4
692.sp
693.if n \{\
694.RS 4
695.\}
696.nf
697net rpc trust create \e
698 otherserver=srv2\&.dom2\&.test \e
699 otheruser=dom2adm \e
700 \-S srv1\&.dom1\&.dom
701.fi
702.if n \{\
703.RE
704.\}
705.RE
706.SS "RPC TRUST DELETE"
707.PP
708Delete a trust object by calling lsaDeleteTrustedDomain\&. The can be done on a single server or on two servers at once\&.
709.PP
710\fBOptions:\fR
711.PP
712otherserver
713.RS 4
714Domain controller of the second domain
715.RE
716.PP
717otheruser
718.RS 4
719Admin user in the second domain
720.RE
721.PP
722otherdomainsid
723.RS 4
724SID of the second domain
725.RE
726.PP
727\fBExamples:\fR
728.PP
729Delete a trust object on srv1\&.dom1\&.dom for the domain dom2
730.RS 4
731.sp
732.if n \{\
733.RS 4
734.\}
735.nf
736net rpc trust delete \e
737 otherdomainsid=S\-x\-x\-xx\-xxxxxxxxxx\-xxxxxxxxxx\-xxxxxxxxx \e
738 \-S srv1\&.dom1\&.dom
739.fi
740.if n \{\
741.RE
742.\}
743.RE
744.PP
745Delete a trust relationship between dom1 and dom2
746.RS 4
747.sp
748.if n \{\
749.RS 4
750.\}
751.nf
752net rpc trust delete \e
753 otherserver=srv2\&.dom2\&.test \e
754 otheruser=dom2adm \e
755 \-S srv1\&.dom1\&.dom
756.fi
757.if n \{\
758.RE
759.\}
760.RE
761.SS ""
762.SS "RPC RIGHTS"
763.PP
764This subcommand is used to view and manage Samba\*(Aqs rights assignments (also referred to as privileges)\&. There are three options currently available:
765\fIlist\fR,
766\fIgrant\fR, and
767\fIrevoke\fR\&. More details on Samba\*(Aqs privilege model and its use can be found in the Samba\-HOWTO\-Collection\&.
768.SS "RPC ABORTSHUTDOWN"
769.PP
770Abort the shutdown of a remote server\&.
771.SS "RPC SHUTDOWN [\-t timeout] [\-r] [\-f] [\-C message]"
772.PP
773Shut down the remote server\&.
774.PP
775\-r
776.RS 4
777Reboot after shutdown\&.
778.RE
779.PP
780\-f
781.RS 4
782Force shutting down all applications\&.
783.RE
784.PP
785\-t timeout
786.RS 4
787Timeout before system will be shut down\&. An interactive user of the system can use this time to cancel the shutdown\&.
788.RE
789.PP
790\-C message
791.RS 4
792Display the specified message on the screen to announce the shutdown\&.
793.RE
794.SS "RPC SAMDUMP"
795.PP
796Print out sam database of remote server\&. You need to run this against the PDC, from a Samba machine joined as a BDC\&.
797.SS "RPC VAMPIRE"
798.PP
799Export users, aliases and groups from remote server to local server\&. You need to run this against the PDC, from a Samba machine joined as a BDC\&. This vampire command cannot be used against an Active Directory, only against an NT4 Domain Controller\&.
800.SS "RPC VAMPIRE KEYTAB"
801.PP
802Dump remote SAM database to local Kerberos keytab file\&.
803.SS "RPC VAMPIRE LDIF"
804.PP
805Dump remote SAM database to local LDIF file or standard output\&.
806.SS "RPC GETSID"
807.PP
808Fetch domain SID and store it in the local
809secrets\&.tdb\&.
810.SS "ADS LEAVE"
811.PP
812Make the remote host leave the domain it is part of\&.
813.SS "ADS STATUS"
814.PP
815Print out status of machine account of the local machine in ADS\&. Prints out quite some debug info\&. Aimed at developers, regular users should use
816NET ADS TESTJOIN\&.
817.SS "ADS PRINTER"
818.SS "ADS PRINTER INFO [PRINTER] [SERVER]"
819.PP
820Lookup info for
821\fIPRINTER\fR
822on
823\fISERVER\fR\&. The printer name defaults to "*", the server name defaults to the local host\&.
824.SS "ADS PRINTER PUBLISH PRINTER"
825.PP
826Publish specified printer using ADS\&.
827.SS "ADS PRINTER REMOVE PRINTER"
828.PP
829Remove specified printer from ADS directory\&.
830.SS "ADS SEARCH \fIEXPRESSION\fR \fIATTRIBUTES\&.\&.\&.\fR"
831.PP
832Perform a raw LDAP search on a ADS server and dump the results\&. The expression is a standard LDAP search expression, and the attributes are a list of LDAP fields to show in the results\&.
833.PP
834Example:
835\fBnet ads search \*(Aq(objectCategory=group)\*(Aq sAMAccountName\fR
836.SS "ADS DN \fIDN\fR \fI(attributes)\fR"
837.PP
838Perform a raw LDAP search on a ADS server and dump the results\&. The DN standard LDAP DN, and the attributes are a list of LDAP fields to show in the result\&.
839.PP
840Example:
841\fBnet ads dn \*(AqCN=administrator,CN=Users,DC=my,DC=domain\*(Aq SAMAccountName\fR
842.SS "ADS WORKGROUP"
843.PP
844Print out workgroup name for specified kerberos realm\&.
845.SS "ADS ENCTYPES"
846.PP
847List, modify or delete the value of the "msDS\-SupportedEncryptionTypes" attribute of an account in AD\&.
848.PP
849This attribute allows one to control which Kerberos encryption types are used for the generation of initial and service tickets\&. The value consists of an integer bitmask with the following values:
850.PP
8510x00000001 DES\-CBC\-CRC
852.PP
8530x00000002 DES\-CBC\-MD5
854.PP
8550x00000004 RC4\-HMAC
856.PP
8570x00000008 AES128\-CTS\-HMAC\-SHA1\-96
858.PP
8590x00000010 AES256\-CTS\-HMAC\-SHA1\-96
860.SS "ADS ENCTYPES LIST \fI<ACCOUNTNAME>\fR"
861.PP
862List the value of the "msDS\-SupportedEncryptionTypes" attribute of a given account\&.
863.PP
864Example:
865\fBnet ads enctypes list Computername\fR
866.SS "ADS ENCTYPES SET \fI<ACCOUNTNAME>\fR \fI[enctypes]\fR"
867.PP
868Set the value of the "msDS\-SupportedEncryptionTypes" attribute of the LDAP object of ACCOUNTNAME to a given value\&. If the value is omitted, the value is set to 31 which enables all the currently supported encryption types\&.
869.PP
870Example:
871\fBnet ads enctypes set Computername 24\fR
872.SS "ADS ENCTYPES DELETE \fI<ACCOUNTNAME>\fR"
873.PP
874Deletes the "msDS\-SupportedEncryptionTypes" attribute of the LDAP object of ACCOUNTNAME\&.
875.PP
876Example:
877\fBnet ads enctypes set Computername 24\fR
878.SS "SAM CREATEBUILTINGROUP <NAME>"
879.PP
880(Re)Create a BUILTIN group\&. Only a wellknown set of BUILTIN groups can be created with this command\&. This is the list of currently recognized group names: Administrators, Users, Guests, Power Users, Account Operators, Server Operators, Print Operators, Backup Operators, Replicator, RAS Servers, Pre\-Windows 2000 compatible Access\&. This command requires a running Winbindd with idmap allocation properly configured\&. The group gid will be allocated out of the winbindd range\&.
881.SS "SAM CREATELOCALGROUP <NAME>"
882.PP
883Create a LOCAL group (also known as Alias)\&. This command requires a running Winbindd with idmap allocation properly configured\&. The group gid will be allocated out of the winbindd range\&.
884.SS "SAM DELETELOCALGROUP <NAME>"
885.PP
886Delete an existing LOCAL group (also known as Alias)\&.
887.SS "SAM MAPUNIXGROUP <NAME>"
888.PP
889Map an existing Unix group and make it a Domain Group, the domain group will have the same name\&.
890.SS "SAM UNMAPUNIXGROUP <NAME>"
891.PP
892Remove an existing group mapping entry\&.
893.SS "SAM ADDMEM <GROUP> <MEMBER>"
894.PP
895Add a member to a Local group\&. The group can be specified only by name, the member can be specified by name or SID\&.
896.SS "SAM DELMEM <GROUP> <MEMBER>"
897.PP
898Remove a member from a Local group\&. The group and the member must be specified by name\&.
899.SS "SAM LISTMEM <GROUP>"
900.PP
901List Local group members\&. The group must be specified by name\&.
902.SS "SAM LIST <users|groups|localgroups|builtin|workstations> [verbose]"
903.PP
904List the specified set of accounts by name\&. If verbose is specified, the rid and description is also provided for each account\&.
905.SS "SAM RIGHTS LIST"
906.PP
907List all available privileges\&.
908.SS "SAM RIGHTS GRANT <NAME> <PRIVILEGE>"
909.PP
910Grant one or more privileges to a user\&.
911.SS "SAM RIGHTS REVOKE <NAME> <PRIVILEGE>"
912.PP
913Revoke one or more privileges from a user\&.
914.SS "SAM SHOW <NAME>"
915.PP
916Show the full DOMAIN\e\eNAME the SID and the type for the corresponding account\&.
917.SS "SAM SET HOMEDIR <NAME> <DIRECTORY>"
918.PP
919Set the home directory for a user account\&.
920.SS "SAM SET PROFILEPATH <NAME> <PATH>"
921.PP
922Set the profile path for a user account\&.
923.SS "SAM SET COMMENT <NAME> <COMMENT>"
924.PP
925Set the comment for a user or group account\&.
926.SS "SAM SET FULLNAME <NAME> <FULL NAME>"
927.PP
928Set the full name for a user account\&.
929.SS "SAM SET LOGONSCRIPT <NAME> <SCRIPT>"
930.PP
931Set the logon script for a user account\&.
932.SS "SAM SET HOMEDRIVE <NAME> <DRIVE>"
933.PP
934Set the home drive for a user account\&.
935.SS "SAM SET WORKSTATIONS <NAME> <WORKSTATIONS>"
936.PP
937Set the workstations a user account is allowed to log in from\&.
938.SS "SAM SET DISABLE <NAME>"
939.PP
940Set the "disabled" flag for a user account\&.
941.SS "SAM SET PWNOTREQ <NAME>"
942.PP
943Set the "password not required" flag for a user account\&.
944.SS "SAM SET AUTOLOCK <NAME>"
945.PP
946Set the "autolock" flag for a user account\&.
947.SS "SAM SET PWNOEXP <NAME>"
948.PP
949Set the "password do not expire" flag for a user account\&.
950.SS "SAM SET PWDMUSTCHANGENOW <NAME> [yes|no]"
951.PP
952Set or unset the "password must change" flag for a user account\&.
953.SS "SAM POLICY LIST"
954.PP
955List the available account policies\&.
956.SS "SAM POLICY SHOW <account policy>"
957.PP
958Show the account policy value\&.
959.SS "SAM POLICY SET <account policy> <value>"
960.PP
961Set a value for the account policy\&. Valid values can be: "forever", "never", "off", or a number\&.
962.SS "SAM PROVISION"
963.PP
964Only available if ldapsam:editposix is set and winbindd is running\&. Properly populates the ldap tree with the basic accounts (Administrator) and groups (Domain Users, Domain Admins, Domain Guests) on the ldap tree\&.
965.SS "IDMAP DUMP <local tdb file name>"
966.PP
967Dumps the mappings contained in the local tdb file specified\&. This command is useful to dump only the mappings produced by the idmap_tdb backend\&.
968.SS "IDMAP RESTORE [input file]"
969.PP
970Restore the mappings from the specified file or stdin\&.
971.SS "IDMAP SET SECRET <DOMAIN> <secret>"
972.PP
973Store a secret for the specified domain, used primarily for domains that use idmap_ldap as a backend\&. In this case the secret is used as the password for the user DN used to bind to the ldap server\&.
974.SS "IDMAP SET RANGE <RANGE> <SID> [index] [\-\-db=<DB>]"
975.PP
976Store a domain\-range mapping for a given domain (and index) in autorid database\&.
977.SS "IDMAP SET CONFIG <config> [\-\-db=<DB>]"
978.PP
979Update CONFIG entry in autorid database\&.
980.SS "IDMAP GET RANGE <SID> [index] [\-\-db=<DB>]"
981.PP
982Get the range for a given domain and index from autorid database\&.
983.SS "IDMAP GET RANGES [<SID>] [\-\-db=<DB>]"
984.PP
985Get ranges for all domains or for one identified by given SID\&.
986.SS "IDMAP GET CONFIG [\-\-db=<DB>]"
987.PP
988Get CONFIG entry from autorid database\&.
989.SS "IDMAP DELETE MAPPING [\-f] [\-\-db=<DB>] <ID>"
990.PP
991Delete a mapping sid <\-> gid or sid <\-> uid from the IDMAP database\&. The mapping is given by <ID> which may either be a sid: S\-x\-\&.\&.\&., a gid: "GID number" or a uid: "UID number"\&. Use \-f to delete an invalid partial mapping <ID> \-> xx
992.PP
993Use "smbcontrol all idmap \&.\&.\&." to notify running smbd instances\&. See the
994\fBsmbcontrol\fR(1)
995manpage for details\&.
996.SS "IDMAP DELETE RANGE [\-f] [\-\-db=<TDB>] <RANGE>|(<SID> [<INDEX>])"
997.PP
998Delete a domain range mapping identified by \*(AqRANGE\*(Aq or "domain SID and INDEX" from autorid database\&. Use \-f to delete invalid mappings\&.
999.SS "IDMAP DELETE RANGES [\-f] [\-\-db=<TDB>] <SID>"
1000.PP
1001Delete all domain range mappings for a domain identified by SID\&. Use \-f to delete invalid mappings\&.
1002.SS "IDMAP CHECK [\-v] [\-r] [\-a] [\-T] [\-f] [\-l] [\-\-db=<DB>]"
1003.PP
1004Check and repair the IDMAP database\&. If no option is given a read only check of the database is done\&. Among others an interactive or automatic repair mode may be chosen with one of the following options:
1005.PP
1006\-r|\-\-repair
1007.RS 4
1008Interactive repair mode, ask a lot of questions\&.
1009.RE
1010.PP
1011\-a|\-\-auto
1012.RS 4
1013Noninteractive repair mode, use default answers\&.
1014.RE
1015.PP
1016\-v|\-\-verbose
1017.RS 4
1018Produce more output\&.
1019.RE
1020.PP
1021\-f|\-\-force
1022.RS 4
1023Try to apply changes, even if they do not apply cleanly\&.
1024.RE
1025.PP
1026\-T|\-\-test
1027.RS 4
1028Dry run, show what changes would be made but don\*(Aqt touch anything\&.
1029.RE
1030.PP
1031\-l|\-\-lock
1032.RS 4
1033Lock the database while doing the check\&.
1034.RE
1035.PP
1036\-\-db <DB>
1037.RS 4
1038Check the specified database\&.
1039.RE
1040.PP
1041.RS 4
1042.RE
1043It reports about the finding of the following errors:
1044.PP
1045Missing reverse mapping:
1046.RS 4
1047A record with mapping A\->B where there is no B\->A\&. Default action in repair mode is to "fix" this by adding the reverse mapping\&.
1048.RE
1049.PP
1050Invalid mapping:
1051.RS 4
1052A record with mapping A\->B where B\->C\&. Default action is to "delete" this record\&.
1053.RE
1054.PP
1055Missing or invalid HWM:
1056.RS 4
1057A high water mark is not at least equal to the largest ID in the database\&. Default action is to "fix" this by setting it to the largest ID found +1\&.
1058.RE
1059.PP
1060Invalid record:
1061.RS 4
1062Something we failed to parse\&. Default action is to "edit" it in interactive and "delete" it in automatic mode\&.
1063.RE
1064.SS "USERSHARE"
1065.PP
1066Starting with version 3\&.0\&.23, a Samba server now supports the ability for non\-root users to add user defined shares to be exported using the "net usershare" commands\&.
1067.PP
1068To set this up, first set up your smb\&.conf by adding to the [global] section: usershare path = /usr/local/samba/lib/usershares Next create the directory /usr/local/samba/lib/usershares, change the owner to root and set the group owner to the UNIX group who should have the ability to create usershares, for example a group called "serverops"\&. Set the permissions on /usr/local/samba/lib/usershares to 01770\&. (Owner and group all access, no access for others, plus the sticky bit, which means that a file in that directory can be renamed or deleted only by the owner of the file)\&. Finally, tell smbd how many usershares you will allow by adding to the [global] section of smb\&.conf a line such as : usershare max shares = 100\&. To allow 100 usershare definitions\&. Now, members of the UNIX group "serverops" can create user defined shares on demand using the commands below\&.
1069.PP
1070The usershare commands are:
1071.RS 4
1072net usershare add sharename path [comment [acl] [guest_ok=[y|n]]] \- to add or change a user defined share\&.
1073.RE
1074.RS 4
1075net usershare delete sharename \- to delete a user defined share\&.
1076.RE
1077.RS 4
1078net usershare info [\-l|\-\-long] [wildcard sharename] \- to print info about a user defined share\&.
1079.RE
1080.RS 4
1081net usershare list [\-l|\-\-long] [wildcard sharename] \- to list user defined shares\&.
1082.RE
1083.SS "USERSHARE ADD sharename path [comment] [acl] [guest_ok=[y|n]]"
1084.PP
1085Add or replace a new user defined share, with name "sharename"\&.
1086.PP
1087"path" specifies the absolute pathname on the system to be exported\&. Restrictions may be put on this, see the global smb\&.conf parameters: "usershare owner only", "usershare prefix allow list", and "usershare prefix deny list"\&.
1088.PP
1089The optional "comment" parameter is the comment that will appear on the share when browsed to by a client\&.
1090.PP
1091The optional "acl" field specifies which users have read and write access to the entire share\&. Note that guest connections are not allowed unless the smb\&.conf parameter "usershare allow guests" has been set\&. The definition of a user defined share acl is: "user:permission", where user is a valid username on the system and permission can be "F", "R", or "D"\&. "F" stands for "full permissions", ie\&. read and write permissions\&. "D" stands for "deny" for a user, ie\&. prevent this user from accessing this share\&. "R" stands for "read only", ie\&. only allow read access to this share (no creation of new files or directories or writing to files)\&.
1092.PP
1093The default if no "acl" is given is "Everyone:R", which means any authenticated user has read\-only access\&.
1094.PP
1095The optional "guest_ok" has the same effect as the parameter of the same name in smb\&.conf, in that it allows guest access to this user defined share\&. This parameter is only allowed if the global parameter "usershare allow guests" has been set to true in the smb\&.conf\&.
1096
1097
1098There is no separate command to modify an existing user defined share,
1099just use the "net usershare add [sharename]" command using the same
1100sharename as the one you wish to modify and specify the new options
1101you wish\&. The Samba smbd daemon notices user defined share modifications
1102at connect time so will see the change immediately, there is no need
1103to restart smbd on adding, deleting or changing a user defined share\&.
1104.SS "USERSHARE DELETE sharename"
1105.PP
1106Deletes the user defined share by name\&. The Samba smbd daemon immediately notices this change, although it will not disconnect any users currently connected to the deleted share\&.
1107.SS "USERSHARE INFO [-l|--long] [wildcard sharename]"
1108.PP
1109Get info on user defined shares owned by the current user matching the given pattern, or all users\&.
1110.PP
1111net usershare info on its own dumps out info on the user defined shares that were created by the current user, or restricts them to share names that match the given wildcard pattern (\*(Aq*\*(Aq matches one or more characters, \*(Aq?\*(Aq matches only one character)\&. If the \*(Aq\-l\*(Aq or \*(Aq\-\-long\*(Aq option is also given, it prints out info on user defined shares created by other users\&.
1112.PP
1113The information given about a share looks like: [foobar] path=/home/jeremy comment=testme usershare_acl=Everyone:F guest_ok=n And is a list of the current settings of the user defined share that can be modified by the "net usershare add" command\&.
1114.SS "USERSHARE LIST [-l|--long] wildcard sharename"
1115.PP
1116List all the user defined shares owned by the current user matching the given pattern, or all users\&.
1117.PP
1118net usershare list on its own list out the names of the user defined shares that were created by the current user, or restricts the list to share names that match the given wildcard pattern (\*(Aq*\*(Aq matches one or more characters, \*(Aq?\*(Aq matches only one character)\&. If the \*(Aq\-l\*(Aq or \*(Aq\-\-long\*(Aq option is also given, it includes the names of user defined shares created by other users\&.
1119.SS "[RPC] CONF"
1120.PP
1121Starting with version 3\&.2\&.0, a Samba server can be configured by data stored in registry\&. This configuration data can be edited with the new "net conf" commands\&. There is also the possibility to configure a remote Samba server by enabling the RPC conf mode and specifying the address of the remote server\&.
1122.PP
1123The deployment of this configuration data can be activated in two levels from the
1124\fIsmb\&.conf\fR
1125file: Share definitions from registry are activated by setting
1126\fIregistry shares\fR
1127to
1128\(lqyes\(rq
1129in the [global] section and global configuration options are activated by setting
1130\m[blue]\fBinclude = registry\fR\m[]
1131in the [global] section for a mixed configuration or by setting
1132\m[blue]\fBconfig backend = registry\fR\m[]
1133in the [global] section for a registry\-only configuration\&. See the
1134\fBsmb.conf\fR(5)
1135manpage for details\&.
1136.PP
1137The conf commands are:
1138.RS 4
1139net [rpc] conf list \- Dump the complete configuration in smb\&.conf like
1140format\&.
1141.RE
1142.RS 4
1143net [rpc] conf import \- Import configuration from file in smb\&.conf
1144format\&.
1145.RE
1146.RS 4
1147net [rpc] conf listshares \- List the registry shares\&.
1148.RE
1149.RS 4
1150net [rpc] conf drop \- Delete the complete configuration from
1151registry\&.
1152.RE
1153.RS 4
1154net [rpc] conf showshare \- Show the definition of a registry share\&.
1155.RE
1156.RS 4
1157net [rpc] conf addshare \- Create a new registry share\&.
1158.RE
1159.RS 4
1160net [rpc] conf delshare \- Delete a registry share\&.
1161.RE
1162.RS 4
1163net [rpc] conf setparm \- Store a parameter\&.
1164.RE
1165.RS 4
1166net [rpc] conf getparm \- Retrieve the value of a parameter\&.
1167.RE
1168.RS 4
1169net [rpc] conf delparm \- Delete a parameter\&.
1170.RE
1171.RS 4
1172net [rpc] conf getincludes \- Show the includes of a share definition\&.
1173.RE
1174.RS 4
1175net [rpc] conf setincludes \- Set includes for a share\&.
1176.RE
1177.RS 4
1178net [rpc] conf delincludes \- Delete includes from a share definition\&.
1179.RE
1180.SS "[RPC] CONF LIST"
1181.PP
1182Print the configuration data stored in the registry in a smb\&.conf\-like format to standard output\&.
1183.SS "[RPC] CONF IMPORT [--test|-T] filename [section]"
1184.PP
1185This command imports configuration from a file in smb\&.conf format\&. If a section encountered in the input file is present in registry, its contents is replaced\&. Sections of registry configuration that have no counterpart in the input file are not affected\&. If you want to delete these, you will have to use the "net conf drop" or "net conf delshare" commands\&. Optionally, a section may be specified to restrict the effect of the import command to that specific section\&. A test mode is enabled by specifying the parameter "\-T" on the commandline\&. In test mode, no changes are made to the registry, and the resulting configuration is printed to standard output instead\&.
1186.SS "[RPC] CONF LISTSHARES"
1187.PP
1188List the names of the shares defined in registry\&.
1189.SS "[RPC] CONF DROP"
1190.PP
1191Delete the complete configuration data from registry\&.
1192.SS "[RPC] CONF SHOWSHARE sharename"
1193.PP
1194Show the definition of the share or section specified\&. It is valid to specify "global" as sharename to retrieve the global configuration options from registry\&.
1195.SS "[RPC] CONF ADDSHARE sharename path [writeable={y|N} [guest_ok={y|N} [comment]]] "
1196.PP
1197Create a new share definition in registry\&. The sharename and path have to be given\&. The share name may
1198\fInot\fR
1199be "global"\&. Optionally, values for the very common options "writeable", "guest ok" and a "comment" may be specified\&. The same result may be obtained by a sequence of "net conf setparm" commands\&.
1200.SS "[RPC] CONF DELSHARE sharename"
1201.PP
1202Delete a share definition from registry\&.
1203.SS "[RPC] CONF SETPARM section parameter value"
1204.PP
1205Store a parameter in registry\&. The section may be global or a sharename\&. The section is created if it does not exist yet\&.
1206.SS "[RPC] CONF GETPARM section parameter"
1207.PP
1208Show a parameter stored in registry\&.
1209.SS "[RPC] CONF DELPARM section parameter"
1210.PP
1211Delete a parameter stored in registry\&.
1212.SS "[RPC] CONF GETINCLUDES section"
1213.PP
1214Get the list of includes for the provided section (global or share)\&.
1215.PP
1216Note that due to the nature of the registry database and the nature of include directives, the includes need special treatment: Parameters are stored in registry by the parameter name as valuename, so there is only ever one instance of a parameter per share\&. Also, a specific order like in a text file is not guaranteed\&. For all real parameters, this is perfectly ok, but the include directive is rather a meta parameter, for which, in the smb\&.conf text file, the place where it is specified between the other parameters is very important\&. This can not be achieved by the simple registry smbconf data model, so there is one ordered list of includes per share, and this list is evaluated after all the parameters of the share\&.
1217.PP
1218Further note that currently, only files can be included from registry configuration\&. In the future, there will be the ability to include configuration data from other registry keys\&.
1219.SS "[RPC] CONF SETINCLUDES section [filename]+"
1220.PP
1221Set the list of includes for the provided section (global or share) to the given list of one or more filenames\&. The filenames may contain the usual smb\&.conf macros like %I\&.
1222.SS "[RPC] CONF DELINCLUDES section"
1223.PP
1224Delete the list of includes from the provided section (global or share)\&.
1225.SS "REGISTRY"
1226.PP
1227Manipulate Samba\*(Aqs registry\&.
1228.PP
1229The registry commands are:
1230.RS 4
1231net registry enumerate \- Enumerate registry keys and values\&.
1232.RE
1233.RS 4
1234net registry enumerate_recursive \- Enumerate registry key and its subkeys\&.
1235.RE
1236.RS 4
1237net registry createkey \- Create a new registry key\&.
1238.RE
1239.RS 4
1240net registry deletekey \- Delete a registry key\&.
1241.RE
1242.RS 4
1243net registry deletekey_recursive \- Delete a registry key with subkeys\&.
1244.RE
1245.RS 4
1246net registry getvalue \- Print a registry value\&.
1247.RE
1248.RS 4
1249net registry getvalueraw \- Print a registry value (raw format)\&.
1250.RE
1251.RS 4
1252net registry setvalue \- Set a new registry value\&.
1253.RE
1254.RS 4
1255net registry increment \- Increment a DWORD registry value under a lock\&.
1256.RE
1257.RS 4
1258net registry deletevalue \- Delete a registry value\&.
1259.RE
1260.RS 4
1261net registry getsd \- Get security descriptor\&.
1262.RE
1263.RS 4
1264net registry getsd_sdd1 \- Get security descriptor in sddl format\&.
1265.RE
1266.RS 4
1267net registry setsd_sdd1 \- Set security descriptor from sddl format
1268string\&.
1269.RE
1270.RS 4
1271net registry import \- Import a registration entries (\&.reg) file\&.
1272.RE
1273.RS 4
1274net registry export \- Export a registration entries (\&.reg) file\&.
1275.RE
1276.RS 4
1277net registry convert \- Convert a registration entries (\&.reg) file\&.
1278.RE
1279.RS 4
1280net registry check \- Check and repair a registry database\&.
1281.RE
1282.SS "REGISTRY ENUMERATE key "
1283.PP
1284Enumerate subkeys and values of
1285\fIkey\fR\&.
1286.SS "REGISTRY ENUMERATE_RECURSIVE key "
1287.PP
1288Enumerate values of
1289\fIkey\fR
1290and its subkeys\&.
1291.SS "REGISTRY CREATEKEY key "
1292.PP
1293Create a new
1294\fIkey\fR
1295if not yet existing\&.
1296.SS "REGISTRY DELETEKEY key "
1297.PP
1298Delete the given
1299\fIkey\fR
1300and its values from the registry, if it has no subkeys\&.
1301.SS "REGISTRY DELETEKEY_RECURSIVE key "
1302.PP
1303Delete the given
1304\fIkey\fR
1305and all of its subkeys and values from the registry\&.
1306.SS "REGISTRY GETVALUE key name"
1307.PP
1308Output type and actual value of the value
1309\fIname\fR
1310of the given
1311\fIkey\fR\&.
1312.SS "REGISTRY GETVALUERAW key name"
1313.PP
1314Output the actual value of the value
1315\fIname\fR
1316of the given
1317\fIkey\fR\&.
1318.SS "REGISTRY SETVALUE key name type value ..."
1319.PP
1320Set the value
1321\fIname\fR
1322of an existing
1323\fIkey\fR\&.
1324\fItype\fR
1325may be one of
1326\fIsz\fR,
1327\fImulti_sz\fR
1328or
1329\fIdword\fR\&. In case of
1330\fImulti_sz\fR\fIvalue\fR
1331may be given multiple times\&.
1332.SS "REGISTRY INCREMENT key name [inc]"
1333.PP
1334Increment the DWORD value
1335\fIname\fR
1336of
1337\fIkey\fR
1338by
1339\fIinc\fR
1340while holding a g_lock\&.
1341\fIinc\fR
1342defaults to 1\&.
1343.SS "REGISTRY DELETEVALUE key name"
1344.PP
1345Delete the value
1346\fIname\fR
1347of the given
1348\fIkey\fR\&.
1349.SS "REGISTRY GETSD key"
1350.PP
1351Get the security descriptor of the given
1352\fIkey\fR\&.
1353.SS "REGISTRY GETSD_SDDL key"
1354.PP
1355Get the security descriptor of the given
1356\fIkey\fR
1357as a Security Descriptor Definition Language (SDDL) string\&.
1358.SS "REGISTRY SETSD_SDDL keysd"
1359.PP
1360Set the security descriptor of the given
1361\fIkey\fR
1362from a Security Descriptor Definition Language (SDDL) string
1363\fIsd\fR\&.
1364.SS "REGISTRY IMPORT file [--precheck <check-file>] [opt]"
1365.PP
1366Import a registration entries (\&.reg)
1367\fIfile\fR\&.
1368.PP
1369The following options are available:
1370.PP
1371\-\-precheck \fIcheck\-file\fR
1372.RS 4
1373This is a mechanism to check the existence or non\-existence of certain keys or values specified in a precheck file before applying the import file\&. The import file will only be applied if the precheck succeeds\&.
1374.sp
1375The check\-file follows the normal registry file syntax with the following semantics:
1376.sp
1377.RS 4
1378.ie n \{\
1379\h'-04'\(bu\h'+03'\c
1380.\}
1381.el \{\
1382.sp -1
1383.IP \(bu 2.3
1384.\}
1385<value name>=<value> checks whether the value exists and has the given value\&.
1386.RE
1387.sp
1388.RS 4
1389.ie n \{\
1390\h'-04'\(bu\h'+03'\c
1391.\}
1392.el \{\
1393.sp -1
1394.IP \(bu 2.3
1395.\}
1396<value name>=\- checks whether the value does not exist\&.
1397.RE
1398.sp
1399.RS 4
1400.ie n \{\
1401\h'-04'\(bu\h'+03'\c
1402.\}
1403.el \{\
1404.sp -1
1405.IP \(bu 2.3
1406.\}
1407[key] checks whether the key exists\&.
1408.RE
1409.sp
1410.RS 4
1411.ie n \{\
1412\h'-04'\(bu\h'+03'\c
1413.\}
1414.el \{\
1415.sp -1
1416.IP \(bu 2.3
1417.\}
1418[\-key] checks whether the key does not exist\&.
1419.RE
1420.sp
1421.RE
1422.RE
1423.SS "REGISTRY EXPORT keyfile[opt]"
1424.PP
1425Export a
1426\fIkey\fR
1427to a registration entries (\&.reg)
1428\fIfile\fR\&.
1429.SS "REGISTRY CONVERT in out [[inopt] outopt]"
1430.PP
1431Convert a registration entries (\&.reg) file
1432\fIin\fR\&.
1433.SS "REGISTRY CHECK [-ravTl] [-o <ODB>] [--wipe] [<DB>]"
1434.PP
1435Check and repair the registry database\&. If no option is given a read only check of the database is done\&. Among others an interactive or automatic repair mode may be chosen with one of the following options
1436.PP
1437\-r|\-\-repair
1438.RS 4
1439Interactive repair mode, ask a lot of questions\&.
1440.RE
1441.PP
1442\-a|\-\-auto
1443.RS 4
1444Noninteractive repair mode, use default answers\&.
1445.RE
1446.PP
1447\-v|\-\-verbose
1448.RS 4
1449Produce more output\&.
1450.RE
1451.PP
1452\-T|\-\-test
1453.RS 4
1454Dry run, show what changes would be made but don\*(Aqt touch anything\&.
1455.RE
1456.PP
1457\-l|\-\-lock
1458.RS 4
1459Lock the database while doing the check\&.
1460.RE
1461.PP
1462\-\-reg\-version={1,2,3}
1463.RS 4
1464Specify the format of the registry database\&. If not given it defaults to the value of the binary or, if an registry\&.tdb is explizitly stated at the commandline, to the value found in the INFO/version record\&.
1465.RE
1466.PP
1467[\-\-db] <DB>
1468.RS 4
1469Check the specified database\&.
1470.RE
1471.PP
1472\-o|\-\-output <ODB>
1473.RS 4
1474Create a new registry database <ODB> instead of modifying the input\&. If <ODB> is already existing \-\-wipe may be used to overwrite it\&.
1475.RE
1476.PP
1477\-\-wipe
1478.RS 4
1479Replace the registry database instead of modifying the input or overwrite an existing output database\&.
1480.RE
1481.PP
1482.RS 4
1483.RE
1484.SS "EVENTLOG"
1485.PP
1486Starting with version 3\&.4\&.0 net can read, dump, import and export native win32 eventlog files (usually *\&.evt)\&. evt files are used by the native Windows eventviewer tools\&.
1487.PP
1488The import and export of evt files can only succeed when
1489\fIeventlog list\fR
1490is used in
1491\fIsmb\&.conf\fR
1492file\&. See the
1493\fBsmb.conf\fR(5)
1494manpage for details\&.
1495.PP
1496The eventlog commands are:
1497.RS 4
1498net eventlog dump \- Dump a eventlog *\&.evt file on the screen\&.
1499.RE
1500.RS 4
1501net eventlog import \- Import a eventlog *\&.evt into the samba internal
1502tdb based representation of eventlogs\&.
1503.RE
1504.RS 4
1505net eventlog export \- Export the samba internal tdb based representation
1506of eventlogs into an eventlog *\&.evt file\&.
1507.RE
1508.SS "EVENTLOG DUMP filename"
1509.PP
1510Prints a eventlog *\&.evt file to standard output\&.
1511.SS "EVENTLOG IMPORT filename eventlog"
1512.PP
1513Imports a eventlog *\&.evt file defined by
1514\fIfilename\fR
1515into the samba internal tdb representation of eventlog defined by
1516\fIeventlog\fR\&.
1517\fIeventlog\fR
1518needs to part of the
1519\fIeventlog list\fR
1520defined in smb\&.conf\&. See the
1521\fBsmb.conf\fR(5)
1522manpage for details\&.
1523.SS "EVENTLOG EXPORT filename eventlog"
1524.PP
1525Exports the samba internal tdb representation of eventlog defined by
1526\fIeventlog\fR
1527to a eventlog *\&.evt file defined by
1528\fIfilename\fR\&.
1529\fIeventlog\fR
1530needs to part of the
1531\fIeventlog list\fR
1532defined in smb\&.conf\&. See the
1533\fBsmb.conf\fR(5)
1534manpage for details\&.
1535.SS "DOM"
1536.PP
1537Starting 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\&.
1538.PP
1539In 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\&.
1540.PP
1541The client side support for remote join is implemented in the net dom commands which are:
1542.RS 4
1543net dom join \- Join a remote computer into a domain\&.
1544.RE
1545.RS 4
1546net dom unjoin \- Unjoin a remote computer from a domain\&.
1547.RE
1548.RS 4
1549net dom renamecomputer \- Renames a remote computer joined to a domain\&.
1550.RE
1551.SS "DOM JOIN domain=DOMAIN ou=OU account=ACCOUNT password=PASSWORD reboot"
1552.PP
1553Joins a computer into a domain\&. This command supports the following additional parameters:
1554.sp
1555.RS 4
1556.ie n \{\
1557\h'-04'\(bu\h'+03'\c
1558.\}
1559.el \{\
1560.sp -1
1561.IP \(bu 2.3
1562.\}
1563\fIDOMAIN\fR
1564can 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 \e separator character\&. Example: MYDOM\eMYDC\&. The
1565\fIDOMAIN\fR
1566parameter cannot be NULL\&.
1567.RE
1568.sp
1569.RS 4
1570.ie n \{\
1571\h'-04'\(bu\h'+03'\c
1572.\}
1573.el \{\
1574.sp -1
1575.IP \(bu 2.3
1576.\}
1577\fIOU\fR
1578can be set to a RFC 1779 LDAP DN, like
1579\fIou=mymachines,cn=Users,dc=example,dc=com\fR
1580in order to create the machine account in a non\-default LDAP container\&. This optional parameter is only supported when joining Active Directory Domains\&.
1581.RE
1582.sp
1583.RS 4
1584.ie n \{\
1585\h'-04'\(bu\h'+03'\c
1586.\}
1587.el \{\
1588.sp -1
1589.IP \(bu 2.3
1590.\}
1591\fIACCOUNT\fR
1592defines 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\&.
1593.RE
1594.sp
1595.RS 4
1596.ie n \{\
1597\h'-04'\(bu\h'+03'\c
1598.\}
1599.el \{\
1600.sp -1
1601.IP \(bu 2.3
1602.\}
1603\fIPASSWORD\fR
1604defines the password for the domain account defined with
1605\fIACCOUNT\fR\&.
1606.RE
1607.sp
1608.RS 4
1609.ie n \{\
1610\h'-04'\(bu\h'+03'\c
1611.\}
1612.el \{\
1613.sp -1
1614.IP \(bu 2.3
1615.\}
1616\fIREBOOT\fR
1617is an optional parameter that can be set to reboot the remote machine after successful join to the domain\&.
1618.RE
1619.sp
1620.RE
1621.PP
1622Note 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\&.
1623.PP
1624Example: net dom join \-S xp \-U XP\e\eadministrator%secret domain=MYDOM account=MYDOM\e\eadministrator password=topsecret reboot\&.
1625.PP
1626This 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\&.
1627.SS "DOM UNJOIN account=ACCOUNT password=PASSWORD reboot"
1628.PP
1629Unjoins a computer from a domain\&. This command supports the following additional parameters:
1630.sp
1631.RS 4
1632.ie n \{\
1633\h'-04'\(bu\h'+03'\c
1634.\}
1635.el \{\
1636.sp -1
1637.IP \(bu 2.3
1638.\}
1639\fIACCOUNT\fR
1640defines 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\&.
1641.RE
1642.sp
1643.RS 4
1644.ie n \{\
1645\h'-04'\(bu\h'+03'\c
1646.\}
1647.el \{\
1648.sp -1
1649.IP \(bu 2.3
1650.\}
1651\fIPASSWORD\fR
1652defines the password for the domain account defined with
1653\fIACCOUNT\fR\&.
1654.RE
1655.sp
1656.RS 4
1657.ie n \{\
1658\h'-04'\(bu\h'+03'\c
1659.\}
1660.el \{\
1661.sp -1
1662.IP \(bu 2.3
1663.\}
1664\fIREBOOT\fR
1665is an optional parameter that can be set to reboot the remote machine after successful unjoin from the domain\&.
1666.RE
1667.sp
1668.RE
1669.PP
1670Note 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\&.
1671.PP
1672Example: net dom unjoin \-S xp \-U XP\e\eadministrator%secret account=MYDOM\e\eadministrator password=topsecret reboot\&.
1673.PP
1674This 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\&.
1675.SS "DOM RENAMECOMPUTER newname=NEWNAME account=ACCOUNT password=PASSWORD reboot"
1676.PP
1677Renames a computer that is joined to a domain\&. This command supports the following additional parameters:
1678.sp
1679.RS 4
1680.ie n \{\
1681\h'-04'\(bu\h'+03'\c
1682.\}
1683.el \{\
1684.sp -1
1685.IP \(bu 2.3
1686.\}
1687\fINEWNAME\fR
1688defines the new name of the machine in the domain\&.
1689.RE
1690.sp
1691.RS 4
1692.ie n \{\
1693\h'-04'\(bu\h'+03'\c
1694.\}
1695.el \{\
1696.sp -1
1697.IP \(bu 2.3
1698.\}
1699\fIACCOUNT\fR
1700defines 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\&.
1701.RE
1702.sp
1703.RS 4
1704.ie n \{\
1705\h'-04'\(bu\h'+03'\c
1706.\}
1707.el \{\
1708.sp -1
1709.IP \(bu 2.3
1710.\}
1711\fIPASSWORD\fR
1712defines the password for the domain account defined with
1713\fIACCOUNT\fR\&.
1714.RE
1715.sp
1716.RS 4
1717.ie n \{\
1718\h'-04'\(bu\h'+03'\c
1719.\}
1720.el \{\
1721.sp -1
1722.IP \(bu 2.3
1723.\}
1724\fIREBOOT\fR
1725is an optional parameter that can be set to reboot the remote machine after successful rename in the domain\&.
1726.RE
1727.sp
1728.RE
1729.PP
1730Note 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\&.
1731.PP
1732Example: net dom renamecomputer \-S xp \-U XP\e\eadministrator%secret newname=XPNEW account=MYDOM\e\eadministrator password=topsecret reboot\&.
1733.PP
1734This 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\&.
1735.SS "G_LOCK"
1736.PP
1737Manage global locks\&.
1738.SS "G_LOCK DO lockname timeout command"
1739.PP
1740Execute a shell command under a global lock\&. This might be useful to define the order in which several shell commands will be executed\&. The locking information is stored in a file called
1741g_lock\&.tdb\&. In setups with CTDB running, the locking information will be available on all cluster nodes\&.
1742.sp
1743.RS 4
1744.ie n \{\
1745\h'-04'\(bu\h'+03'\c
1746.\}
1747.el \{\
1748.sp -1
1749.IP \(bu 2.3
1750.\}
1751\fILOCKNAME\fR
1752defines the name of the global lock\&.
1753.RE
1754.sp
1755.RS 4
1756.ie n \{\
1757\h'-04'\(bu\h'+03'\c
1758.\}
1759.el \{\
1760.sp -1
1761.IP \(bu 2.3
1762.\}
1763\fITIMEOUT\fR
1764defines the timeout\&.
1765.RE
1766.sp
1767.RS 4
1768.ie n \{\
1769\h'-04'\(bu\h'+03'\c
1770.\}
1771.el \{\
1772.sp -1
1773.IP \(bu 2.3
1774.\}
1775\fICOMMAND\fR
1776defines the shell command to execute\&.
1777.RE
1778.SS "G_LOCK LOCKS"
1779.PP
1780Print a list of all currently existing locknames\&.
1781.SS "G_LOCK DUMP lockname"
1782.PP
1783Dump the locking table of a certain global lock\&.
1784.SS "HELP [COMMAND]"
1785.PP
1786Gives usage information for the specified command\&.
1787.SH "VERSION"
1788.PP
1789This man page is complete for version 3 of the Samba suite\&.
1790.SH "AUTHOR"
1791.PP
1792The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&.
1793.PP
1794The net manpage was written by Jelmer Vernooij\&.
Note: See TracBrowser for help on using the repository browser.