source: branches/samba-3.5.x/docs/manpages/net.8@ 773

Last change on this file since 773 was 773, checked in by Herwig Bauernfeind, 12 years ago

Samba Server 3.5: Update branch to 3.5.20

File size: 41.6 KB
Line 
1'\" t
2.\" Title: net
3.\" Author: [see the "AUTHOR" section]
4.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5.\" Date: 12/14/2012
6.\" Manual: System Administration tools
7.\" Source: Samba 3.5
8.\" Language: English
9.\"
10.TH "NET" "8" "12/14/2012" "Samba 3\&.5" "System Administration tools"
11.\" -----------------------------------------------------------------
12.\" * set default formatting
13.\" -----------------------------------------------------------------
14.\" disable hyphenation
15.nh
16.\" disable justification (adjust text to left margin only)
17.ad l
18.\" -----------------------------------------------------------------
19.\" * MAIN CONTENT STARTS HERE *
20.\" -----------------------------------------------------------------
21.SH "NAME"
22net \- Tool for administration of Samba and remote CIFS servers\&.
23.SH "SYNOPSIS"
24.HP \w'\ 'u
25net {<ads|rap|rpc>} [\-h] [\-w\ workgroup] [\-W\ myworkgroup] [\-U\ user] [\-I\ ip\-address] [\-p\ port] [\-n\ myname] [\-s\ conffile] [\-S\ server] [\-l] [\-P] [\-d\ debuglevel] [\-V] [\-\-request\-timeout\ seconds]
26.SH "DESCRIPTION"
27.PP
28This tool is part of the
29\fBsamba\fR(7)
30suite\&.
31.PP
32The 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\&.
33.SH "OPTIONS"
34.PP
35\-h|\-\-help
36.RS 4
37Print a summary of command line options\&.
38.RE
39.PP
40\-w target\-workgroup
41.RS 4
42Sets target workgroup or domain\&. You have to specify either this option or the IP address or the name of a server\&.
43.RE
44.PP
45\-W workgroup
46.RS 4
47Sets client workgroup or domain
48.RE
49.PP
50\-U user
51.RS 4
52User name to use
53.RE
54.PP
55\-I ip\-address
56.RS 4
57IP address of target server to use\&. You have to specify either this option or a target workgroup or a target server\&.
58.RE
59.PP
60\-p port
61.RS 4
62Port on the target server to connect to (usually 139 or 445)\&. Defaults to trying 445 first, then 139\&.
63.RE
64.PP
65\-n|\-\-netbiosname <primary NetBIOS name>
66.RS 4
67This option allows you to override the NetBIOS name that Samba uses for itself\&. This is identical to setting the
68\m[blue]\fBnetbios name\fR\m[]
69parameter in the
70smb\&.conf
71file\&. However, a command line setting will take precedence over settings in
72smb\&.conf\&.
73.RE
74.PP
75\-s|\-\-configfile <configuration file>
76.RS 4
77The file specified contains the configuration details required by the server\&. The information in this file includes server\-specific information such as what printcap file to use, as well as descriptions of all the services that the server is to provide\&. See
78smb\&.conf
79for more information\&. The default configuration file name is determined at compile time\&.
80.RE
81.PP
82\-S server
83.RS 4
84Name of target server\&. You should specify either this option or a target workgroup or a target IP address\&.
85.RE
86.PP
87\-l
88.RS 4
89When listing data, give more information on each item\&.
90.RE
91.PP
92\-P
93.RS 4
94Make queries to the external server using the machine account of the local server\&.
95.RE
96.PP
97\-\-request\-timeout 30
98.RS 4
99Let client requests timeout after 30 seconds the default is 10 seconds\&.
100.RE
101.PP
102\-d|\-\-debuglevel=level
103.RS 4
104\fIlevel\fR
105is an integer from 0 to 10\&. The default value if this parameter is not specified is 0\&.
106.sp
107The higher this value, the more detail will be logged to the log files about the activities of the server\&. At level 0, only critical errors and serious warnings will be logged\&. Level 1 is a reasonable level for day\-to\-day running \- it generates a small amount of information about operations carried out\&.
108.sp
109Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem\&. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic\&.
110.sp
111Note that specifying this parameter here will override the
112\m[blue]\fBlog level\fR\m[]
113parameter in the
114smb\&.conf
115file\&.
116.RE
117.SH "COMMANDS"
118.SS "CHANGESECRETPW"
119.PP
120This 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\&.
121.SS "TIME"
122.PP
123The
124NET TIME
125command 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\&.
126.SS "TIME"
127.PP
128Without any options, the
129NET TIME
130command displays the time on the remote server\&.
131.SS "TIME SYSTEM"
132.PP
133Displays the time on the remote server in a format ready for
134/bin/date\&.
135.SS "TIME SET"
136.PP
137Tries to set the date and time of the local server to that on the remote server using
138/bin/date\&.
139.SS "TIME ZONE"
140.PP
141Displays the timezone in hours from GMT on the remote computer\&.
142.SS "[RPC|ADS] JOIN [TYPE] [\-U username[%password]] [createupn=UPN] [createcomputer=OU] [options]"
143.PP
144Join 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\&.
145.PP
146[TYPE] may be PDC, BDC or MEMBER to specify the type of server joining the domain\&.
147.PP
148[UPN] (ADS only) set the principalname attribute during the join\&. The default format is host/netbiosname@REALM\&.
149.PP
150[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 \'/\'\&. Please note that \'\e\' 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\&.
151.SS "[RPC] OLDJOIN [options]"
152.PP
153Join 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\&.
154.SS "[RPC|ADS] USER"
155.SS "[RPC|ADS] USER"
156.PP
157List all users
158.SS "[RPC|ADS] USER DELETE target"
159.PP
160Delete specified user
161.SS "[RPC|ADS] USER INFO target"
162.PP
163List the domain groups of the specified user\&.
164.SS "[RPC|ADS] USER RENAME oldname newname"
165.PP
166Rename specified user\&.
167.SS "[RPC|ADS] USER ADD name [password] [-F user flags] [-C comment]"
168.PP
169Add specified user\&.
170.SS "[RPC|ADS] GROUP"
171.SS "[RPC|ADS] GROUP [misc options] [targets]"
172.PP
173List user groups\&.
174.SS "[RPC|ADS] GROUP DELETE name [misc. options]"
175.PP
176Delete specified group\&.
177.SS "[RPC|ADS] GROUP ADD name [-C comment]"
178.PP
179Create specified group\&.
180.SS "[RAP|RPC] SHARE"
181.SS "[RAP|RPC] SHARE [misc. options] [targets]"
182.PP
183Enumerates all exported resources (network shares) on target server\&.
184.SS "[RAP|RPC] SHARE ADD name=serverpath [-C comment] [-M maxusers] [targets]"
185.PP
186Adds a share from a server (makes the export active)\&. Maxusers specifies the number of users that can be connected to the share simultaneously\&.
187.SS "SHARE DELETE sharename"
188.PP
189Delete specified share\&.
190.SS "[RPC|RAP] FILE"
191.SS "[RPC|RAP] FILE"
192.PP
193List all open files on remote server\&.
194.SS "[RPC|RAP] FILE CLOSE fileid"
195.PP
196Close file with specified
197\fIfileid\fR
198on remote server\&.
199.SS "[RPC|RAP] FILE INFO fileid"
200.PP
201Print information on specified
202\fIfileid\fR\&. Currently listed are: file\-id, username, locks, path, permissions\&.
203.SS "[RAP|RPC] FILE USER user"
204.PP
205List files opened by specified
206\fIuser\fR\&. Please note that
207net rap file user
208does not work against Samba servers\&.
209.SS "SESSION"
210.SS "RAP SESSION"
211.PP
212Without any other options, SESSION enumerates all active SMB/CIFS sessions on the target server\&.
213.SS "RAP SESSION DELETE|CLOSE CLIENT_NAME"
214.PP
215Close the specified sessions\&.
216.SS "RAP SESSION INFO CLIENT_NAME"
217.PP
218Give a list with all the open files in specified session\&.
219.SS "RAP SERVER \fIDOMAIN\fR"
220.PP
221List all servers in specified domain or workgroup\&. Defaults to local domain\&.
222.SS "RAP DOMAIN"
223.PP
224Lists all domains and workgroups visible on the current network\&.
225.SS "RAP PRINTQ"
226.SS "RAP PRINTQ INFO QUEUE_NAME"
227.PP
228Lists the specified print queue and print jobs on the server\&. If the
229\fIQUEUE_NAME\fR
230is omitted, all queues are listed\&.
231.SS "RAP PRINTQ DELETE JOBID"
232.PP
233Delete job with specified id\&.
234.SS "RAP VALIDATE \fIuser\fR [\fIpassword\fR]"
235.PP
236Validate whether the specified user can log in to the remote server\&. If the password is not specified on the commandline, it will be prompted\&.
237.if n \{\
238.sp
239.\}
240.RS 4
241.it 1 an-trap
242.nr an-no-space-flag 1
243.nr an-break-flag 1
244.br
245.ps +1
246\fBNote\fR
247.ps -1
248.br
249.PP
250Currently NOT implemented\&.
251.sp .5v
252.RE
253.SS "RAP GROUPMEMBER"
254.SS "RAP GROUPMEMBER LIST GROUP"
255.PP
256List all members of the specified group\&.
257.SS "RAP GROUPMEMBER DELETE GROUP USER"
258.PP
259Delete member from group\&.
260.SS "RAP GROUPMEMBER ADD GROUP USER"
261.PP
262Add member to group\&.
263.SS "RAP ADMIN \fIcommand\fR"
264.PP
265Execute the specified
266\fIcommand\fR
267on the remote server\&. Only works with OS/2 servers\&.
268.if n \{\
269.sp
270.\}
271.RS 4
272.it 1 an-trap
273.nr an-no-space-flag 1
274.nr an-break-flag 1
275.br
276.ps +1
277\fBNote\fR
278.ps -1
279.br
280.PP
281Currently NOT implemented\&.
282.sp .5v
283.RE
284.SS "RAP SERVICE"
285.SS "RAP SERVICE START NAME [arguments...]"
286.PP
287Start the specified service on the remote server\&. Not implemented yet\&.
288.if n \{\
289.sp
290.\}
291.RS 4
292.it 1 an-trap
293.nr an-no-space-flag 1
294.nr an-break-flag 1
295.br
296.ps +1
297\fBNote\fR
298.ps -1
299.br
300.PP
301Currently NOT implemented\&.
302.sp .5v
303.RE
304.SS "RAP SERVICE STOP"
305.PP
306Stop the specified service on the remote server\&.
307.if n \{\
308.sp
309.\}
310.RS 4
311.it 1 an-trap
312.nr an-no-space-flag 1
313.nr an-break-flag 1
314.br
315.ps +1
316\fBNote\fR
317.ps -1
318.br
319.PP
320Currently NOT implemented\&.
321.sp .5v
322.RE
323.SS "RAP PASSWORD \fIUSER\fR \fIOLDPASS\fR \fINEWPASS\fR"
324.PP
325Change password of
326\fIUSER\fR
327from
328\fIOLDPASS\fR
329to
330\fINEWPASS\fR\&.
331.SS "LOOKUP"
332.SS "LOOKUP HOST HOSTNAME [TYPE]"
333.PP
334Lookup the IP address of the given host with the specified type (netbios suffix)\&. The type defaults to 0x20 (workstation)\&.
335.SS "LOOKUP LDAP [DOMAIN]"
336.PP
337Give IP address of LDAP server of specified
338\fIDOMAIN\fR\&. Defaults to local domain\&.
339.SS "LOOKUP KDC [REALM]"
340.PP
341Give IP address of KDC for the specified
342\fIREALM\fR\&. Defaults to local realm\&.
343.SS "LOOKUP DC [DOMAIN]"
344.PP
345Give IP\'s of Domain Controllers for specified
346\fI DOMAIN\fR\&. Defaults to local domain\&.
347.SS "LOOKUP MASTER DOMAIN"
348.PP
349Give IP of master browser for specified
350\fIDOMAIN\fR
351or workgroup\&. Defaults to local domain\&.
352.SS "CACHE"
353.PP
354Samba uses a general caching interface called \'gencache\'\&. It can be controlled using \'NET CACHE\'\&.
355.PP
356All the timeout parameters support the suffixes:
357.RS 4
358s \- Seconds
359.RE
360.RS 4
361m \- Minutes
362.RE
363.RS 4
364h \- Hours
365.RE
366.RS 4
367d \- Days
368.RE
369.RS 4
370w \- Weeks
371.RE
372.SS "CACHE ADD key data time-out"
373.PP
374Add specified key+data to the cache with the given timeout\&.
375.SS "CACHE DEL key"
376.PP
377Delete key from the cache\&.
378.SS "CACHE SET key data time-out"
379.PP
380Update data of existing cache entry\&.
381.SS "CACHE SEARCH PATTERN"
382.PP
383Search for the specified pattern in the cache data\&.
384.SS "CACHE LIST"
385.PP
386List all current items in the cache\&.
387.SS "CACHE FLUSH"
388.PP
389Remove all the current items from the cache\&.
390.SS "GETLOCALSID [DOMAIN]"
391.PP
392Prints the SID of the specified domain, or if the parameter is omitted, the SID of the local server\&.
393.SS "SETLOCALSID S\-1\-5\-21\-x\-y\-z"
394.PP
395Sets SID for the local server to the specified SID\&.
396.SS "GETDOMAINSID"
397.PP
398Prints the local machine SID and the SID of the current domain\&.
399.SS "SETDOMAINSID"
400.PP
401Sets the SID of the current domain\&.
402.SS "GROUPMAP"
403.PP
404Manage the mappings between Windows group SIDs and UNIX groups\&. Common options include:
405.sp
406.RS 4
407.ie n \{\
408\h'-04'\(bu\h'+03'\c
409.\}
410.el \{\
411.sp -1
412.IP \(bu 2.3
413.\}
414unixgroup \- Name of the UNIX group
415.RE
416.sp
417.RS 4
418.ie n \{\
419\h'-04'\(bu\h'+03'\c
420.\}
421.el \{\
422.sp -1
423.IP \(bu 2.3
424.\}
425ntgroup \- Name of the Windows NT group (must be resolvable to a SID
426.RE
427.sp
428.RS 4
429.ie n \{\
430\h'-04'\(bu\h'+03'\c
431.\}
432.el \{\
433.sp -1
434.IP \(bu 2.3
435.\}
436rid \- Unsigned 32\-bit integer
437.RE
438.sp
439.RS 4
440.ie n \{\
441\h'-04'\(bu\h'+03'\c
442.\}
443.el \{\
444.sp -1
445.IP \(bu 2.3
446.\}
447sid \- Full SID in the form of "S\-1\-\&.\&.\&."
448.RE
449.sp
450.RS 4
451.ie n \{\
452\h'-04'\(bu\h'+03'\c
453.\}
454.el \{\
455.sp -1
456.IP \(bu 2.3
457.\}
458type \- Type of the group; either \'domain\', \'local\', or \'builtin\'
459.RE
460.sp
461.RS 4
462.ie n \{\
463\h'-04'\(bu\h'+03'\c
464.\}
465.el \{\
466.sp -1
467.IP \(bu 2.3
468.\}
469comment \- Freeform text description of the group
470.sp
471.RE
472.SS "GROUPMAP ADD"
473.PP
474Add a new group mapping entry:
475.sp
476.if n \{\
477.RS 4
478.\}
479.nf
480net groupmap add {rid=int|sid=string} unixgroup=string \e
481 [type={domain|local}] [ntgroup=string] [comment=string]
482.fi
483.if n \{\
484.RE
485.\}
486.sp
487
488.SS "GROUPMAP DELETE"
489.PP
490Delete a group mapping entry\&. If more than one group name matches, the first entry found is deleted\&.
491.PP
492net groupmap delete {ntgroup=string|sid=SID}
493.SS "GROUPMAP MODIFY"
494.PP
495Update en existing group entry\&.
496.PP
497
498.sp
499.if n \{\
500.RS 4
501.\}
502.nf
503net groupmap modify {ntgroup=string|sid=SID} [unixgroup=string] \e
504 [comment=string] [type={domain|local}]
505.fi
506.if n \{\
507.RE
508.\}
509.sp
510
511.SS "GROUPMAP LIST"
512.PP
513List existing group mapping entries\&.
514.PP
515net groupmap list [verbose] [ntgroup=string] [sid=SID]
516.SS "MAXRID"
517.PP
518Prints out the highest RID currently in use on the local server (by the active \'passdb backend\')\&.
519.SS "RPC INFO"
520.PP
521Print information about the domain of the remote server, such as domain name, domain sid and number of users and groups\&.
522.SS "[RPC|ADS] TESTJOIN"
523.PP
524Check whether participation in a domain is still valid\&.
525.SS "[RPC|ADS] CHANGETRUSTPW"
526.PP
527Force change of domain trust password\&.
528.SS "RPC TRUSTDOM"
529.SS "RPC TRUSTDOM ADD DOMAIN"
530.PP
531Add a interdomain trust account for
532\fIDOMAIN\fR\&. This is in fact a Samba account named
533\fIDOMAIN$\fR
534with the account flag
535\fB\'I\'\fR
536(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
537smbpasswd \-a \-i DOMAIN\&. Please note that both commands expect a appropriate UNIX account\&.
538.SS "RPC TRUSTDOM DEL DOMAIN"
539.PP
540Remove interdomain trust account for
541\fIDOMAIN\fR\&. If it is used against localhost it has the same effect as
542smbpasswd \-x DOMAIN$\&.
543.SS "RPC TRUSTDOM ESTABLISH DOMAIN"
544.PP
545Establish 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\'ll need winbind and a working idmap config to make them appear in your system\&.
546.SS "RPC TRUSTDOM REVOKE DOMAIN"
547.PP
548Abandon relationship to trusted domain
549.SS "RPC TRUSTDOM LIST"
550.PP
551List all interdomain trust relationships\&.
552.SS "RPC RIGHTS"
553.PP
554This subcommand is used to view and manage Samba\'s rights assignments (also referred to as privileges)\&. There are three options currently available:
555\fIlist\fR,
556\fIgrant\fR, and
557\fIrevoke\fR\&. More details on Samba\'s privilege model and its use can be found in the Samba\-HOWTO\-Collection\&.
558.SS "RPC ABORTSHUTDOWN"
559.PP
560Abort the shutdown of a remote server\&.
561.SS "RPC SHUTDOWN [\-t timeout] [\-r] [\-f] [\-C message]"
562.PP
563Shut down the remote server\&.
564.PP
565\-r
566.RS 4
567Reboot after shutdown\&.
568.RE
569.PP
570\-f
571.RS 4
572Force shutting down all applications\&.
573.RE
574.PP
575\-t timeout
576.RS 4
577Timeout before system will be shut down\&. An interactive user of the system can use this time to cancel the shutdown\&.
578.RE
579.PP
580\-C message
581.RS 4
582Display the specified message on the screen to announce the shutdown\&.
583.RE
584.SS "RPC SAMDUMP"
585.PP
586Print out sam database of remote server\&. You need to run this against the PDC, from a Samba machine joined as a BDC\&.
587.SS "RPC VAMPIRE"
588.PP
589Export 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\&.
590.SS "RPC VAMPIRE KEYTAB"
591.PP
592Dump remote SAM database to local Kerberos keytab file\&.
593.SS "RPC VAMPIRE LDIF"
594.PP
595Dump remote SAM database to local LDIF file or standard output\&.
596.SS "RPC GETSID"
597.PP
598Fetch domain SID and store it in the local
599secrets\&.tdb\&.
600.SS "ADS LEAVE"
601.PP
602Make the remote host leave the domain it is part of\&.
603.SS "ADS STATUS"
604.PP
605Print out status of machine account of the local machine in ADS\&. Prints out quite some debug info\&. Aimed at developers, regular users should use
606NET ADS TESTJOIN\&.
607.SS "ADS PRINTER"
608.SS "ADS PRINTER INFO [PRINTER] [SERVER]"
609.PP
610Lookup info for
611\fIPRINTER\fR
612on
613\fISERVER\fR\&. The printer name defaults to "*", the server name defaults to the local host\&.
614.SS "ADS PRINTER PUBLISH PRINTER"
615.PP
616Publish specified printer using ADS\&.
617.SS "ADS PRINTER REMOVE PRINTER"
618.PP
619Remove specified printer from ADS directory\&.
620.SS "ADS SEARCH \fIEXPRESSION\fR \fIATTRIBUTES\&.\&.\&.\fR"
621.PP
622Perform 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\&.
623.PP
624Example:
625\fBnet ads search \'(objectCategory=group)\' sAMAccountName\fR
626.SS "ADS DN \fIDN\fR \fI(attributes)\fR"
627.PP
628Perform 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\&.
629.PP
630Example:
631\fBnet ads dn \'CN=administrator,CN=Users,DC=my,DC=domain\' SAMAccountName\fR
632.SS "ADS WORKGROUP"
633.PP
634Print out workgroup name for specified kerberos realm\&.
635.SS "SAM CREATEBUILTINGROUP <NAME>"
636.PP
637(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\&.
638.SS "SAM CREATELOCALGROUP <NAME>"
639.PP
640Create 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\&.
641.SS "SAM DELETELOCALGROUP <NAME>"
642.PP
643Delete an existing LOCAL group (also known as Alias)\&.
644.SS "SAM MAPUNIXGROUP <NAME>"
645.PP
646Map an existing Unix group and make it a Domain Group, the domain group will have the same name\&.
647.SS "SAM UNMAPUNIXGROUP <NAME>"
648.PP
649Remove an existing group mapping entry\&.
650.SS "SAM ADDMEM <GROUP> <MEMBER>"
651.PP
652Add a member to a Local group\&. The group can be specified only by name, the member can be specified by name or SID\&.
653.SS "SAM DELMEM <GROUP> <MEMBER>"
654.PP
655Remove a member from a Local group\&. The group and the member must be specified by name\&.
656.SS "SAM LISTMEM <GROUP>"
657.PP
658List Local group members\&. The group must be specified by name\&.
659.SS "SAM LIST <users|groups|localgroups|builtin|workstations> [verbose]"
660.PP
661List the specified set of accounts by name\&. If verbose is specified, the rid and description is also provided for each account\&.
662.SS "SAM RIGHTS LIST"
663.PP
664List all available privileges\&.
665.SS "SAM RIGHTS GRANT <NAME> <PRIVILEGE>"
666.PP
667Grant one or more privileges to a user\&.
668.SS "SAM RIGHTS REVOKE <NAME> <PRIVILEGE>"
669.PP
670Revoke one or more privileges from a user\&.
671.SS "SAM SHOW <NAME>"
672.PP
673Show the full DOMAIN\e\eNAME the SID and the type for the corresponding account\&.
674.SS "SAM SET HOMEDIR <NAME> <DIRECTORY>"
675.PP
676Set the home directory for a user account\&.
677.SS "SAM SET PROFILEPATH <NAME> <PATH>"
678.PP
679Set the profile path for a user account\&.
680.SS "SAM SET COMMENT <NAME> <COMMENT>"
681.PP
682Set the comment for a user or group account\&.
683.SS "SAM SET FULLNAME <NAME> <FULL NAME>"
684.PP
685Set the full name for a user account\&.
686.SS "SAM SET LOGONSCRIPT <NAME> <SCRIPT>"
687.PP
688Set the logon script for a user account\&.
689.SS "SAM SET HOMEDRIVE <NAME> <DRIVE>"
690.PP
691Set the home drive for a user account\&.
692.SS "SAM SET WORKSTATIONS <NAME> <WORKSTATIONS>"
693.PP
694Set the workstations a user account is allowed to log in from\&.
695.SS "SAM SET DISABLE <NAME>"
696.PP
697Set the "disabled" flag for a user account\&.
698.SS "SAM SET PWNOTREQ <NAME>"
699.PP
700Set the "password not required" flag for a user account\&.
701.SS "SAM SET AUTOLOCK <NAME>"
702.PP
703Set the "autolock" flag for a user account\&.
704.SS "SAM SET PWNOEXP <NAME>"
705.PP
706Set the "password do not expire" flag for a user account\&.
707.SS "SAM SET PWDMUSTCHANGENOW <NAME> [yes|no]"
708.PP
709Set or unset the "password must change" flag for a user account\&.
710.SS "SAM POLICY LIST"
711.PP
712List the available account policies\&.
713.SS "SAM POLICY SHOW <account policy>"
714.PP
715Show the account policy value\&.
716.SS "SAM POLICY SET <account policy> <value>"
717.PP
718Set a value for the account policy\&. Valid values can be: "forever", "never", "off", or a number\&.
719.SS "SAM PROVISION"
720.PP
721Only 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\&.
722.SS "IDMAP DUMP <local tdb file name>"
723.PP
724Dumps the mappings contained in the local tdb file specified\&. This command is useful to dump only the mappings produced by the idmap_tdb backend\&.
725.SS "IDMAP RESTORE [input file]"
726.PP
727Restore the mappings from the specified file or stdin\&.
728.SS "IDMAP SECRET <DOMAIN>|ALLOC <secret>"
729.PP
730Store 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\&.
731.SS "USERSHARE"
732.PP
733Starting 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\&.
734.PP
735To 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\&.
736.PP
737The usershare commands are:
738.RS 4
739net usershare add sharename path [comment [acl] [guest_ok=[y|n]]] \- to add or change a user defined share\&.
740.RE
741.RS 4
742net usershare delete sharename \- to delete a user defined share\&.
743.RE
744.RS 4
745net usershare info [\-l|\-\-long] [wildcard sharename] \- to print info about a user defined share\&.
746.RE
747.RS 4
748net usershare list [\-l|\-\-long] [wildcard sharename] \- to list user defined shares\&.
749.RE
750.SS "USERSHARE ADD sharename path [comment] [acl] [guest_ok=[y|n]]"
751.PP
752Add or replace a new user defined share, with name "sharename"\&.
753.PP
754"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"\&.
755.PP
756The optional "comment" parameter is the comment that will appear on the share when browsed to by a client\&.
757.PP
758The 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)\&.
759.PP
760The default if no "acl" is given is "Everyone:R", which means any authenticated user has read\-only access\&.
761.PP
762The 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\&.
763
764
765There is no separate command to modify an existing user defined share,
766just use the "net usershare add [sharename]" command using the same
767sharename as the one you wish to modify and specify the new options
768you wish\&. The Samba smbd daemon notices user defined share modifications
769at connect time so will see the change immediately, there is no need
770to restart smbd on adding, deleting or changing a user defined share\&.
771.SS "USERSHARE DELETE sharename"
772.PP
773Deletes 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\&.
774.SS "USERSHARE INFO [-l|--long] [wildcard sharename]"
775.PP
776Get info on user defined shares owned by the current user matching the given pattern, or all users\&.
777.PP
778net 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 (\'*\' matches one or more characters, \'?\' matches only one character)\&. If the \'\-l\' or \'\-\-long\' option is also given, it prints out info on user defined shares created by other users\&.
779.PP
780The 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\&.
781.SS "USERSHARE LIST [-l|--long] wildcard sharename"
782.PP
783List all the user defined shares owned by the current user matching the given pattern, or all users\&.
784.PP
785net 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 (\'*\' matches one or more characters, \'?\' matches only one character)\&. If the \'\-l\' or \'\-\-long\' option is also given, it includes the names of user defined shares created by other users\&.
786.SS "CONF"
787.PP
788Starting 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\&.
789.PP
790The deployment of this configuration data can be activated in two levels from the
791\fIsmb\&.conf\fR
792file: Share definitions from registry are activated by setting
793\fIregistry shares\fR
794to
795\(lqyes\(rq
796in the [global] section and global configuration options are activated by setting
797\m[blue]\fBinclude = registry\fR\m[]
798in the [global] section for a mixed configuration or by setting
799\m[blue]\fBconfig backend = registry\fR\m[]
800in the [global] section for a registry\-only configuration\&. See the
801\fBsmb.conf\fR(5)
802manpage for details\&.
803.PP
804The conf commands are:
805.RS 4
806net conf list \- Dump the complete configuration in smb\&.conf like
807format\&.
808.RE
809.RS 4
810net conf import \- Import configuration from file in smb\&.conf
811format\&.
812.RE
813.RS 4
814net conf listshares \- List the registry shares\&.
815.RE
816.RS 4
817net conf drop \- Delete the complete configuration from
818registry\&.
819.RE
820.RS 4
821net conf showshare \- Show the definition of a registry share\&.
822.RE
823.RS 4
824net conf addshare \- Create a new registry share\&.
825.RE
826.RS 4
827net conf delshare \- Delete a registry share\&.
828.RE
829.RS 4
830net conf setparm \- Store a parameter\&.
831.RE
832.RS 4
833net conf getparm \- Retrieve the value of a parameter\&.
834.RE
835.RS 4
836net conf delparm \- Delete a parameter\&.
837.RE
838.RS 4
839net conf getincludes \- Show the includes of a share definition\&.
840.RE
841.RS 4
842net conf setincludes \- Set includes for a share\&.
843.RE
844.RS 4
845net conf delincludes \- Delete includes from a share definition\&.
846.RE
847.SS "CONF LIST"
848.PP
849Print the configuration data stored in the registry in a smb\&.conf\-like format to standard output\&.
850.SS "CONF IMPORT [--test|-T] filename [section]"
851.PP
852This 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\&.
853.SS "CONF LISTSHARES"
854.PP
855List the names of the shares defined in registry\&.
856.SS "CONF DROP"
857.PP
858Delete the complete configuration data from registry\&.
859.SS "CONF SHOWSHARE sharename"
860.PP
861Show the definition of the share or section specified\&. It is valid to specify "global" as sharename to retrieve the global configuration options from registry\&.
862.SS "CONF ADDSHARE sharename path [writeable={y|N} [guest_ok={y|N} [comment]]] "
863.PP
864Create a new share definition in registry\&. The sharename and path have to be given\&. The share name may
865\fInot\fR
866be "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\&.
867.SS "CONF DELSHARE sharename"
868.PP
869Delete a share definition from registry\&.
870.SS "CONF SETPARM section parameter value"
871.PP
872Store a parameter in registry\&. The section may be global or a sharename\&. The section is created if it does not exist yet\&.
873.SS "CONF GETPARM section parameter"
874.PP
875Show a parameter stored in registry\&.
876.SS "CONF DELPARM section parameter"
877.PP
878Delete a parameter stored in registry\&.
879.SS "CONF GETINCLUDES section"
880.PP
881Get the list of includes for the provided section (global or share)\&.
882.PP
883Note 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\&.
884.PP
885Further 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\&.
886.SS "CONF SETINCLUDES section [filename]+"
887.PP
888Set 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\&.
889.SS "CONF DELINCLUDES section"
890.PP
891Delete the list of includes from the provided section (global or share)\&.
892.SS "EVENTLOG"
893.PP
894Starting 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\&.
895.PP
896The import and export of evt files can only succeed when
897\fIeventlog list\fR
898is used in
899\fIsmb\&.conf\fR
900file\&. See the
901\fBsmb.conf\fR(5)
902manpage for details\&.
903.PP
904The eventlog commands are:
905.RS 4
906net eventlog dump \- Dump a eventlog *\&.evt file on the screen\&.
907.RE
908.RS 4
909net eventlog import \- Import a eventlog *\&.evt into the samba internal
910tdb based representation of eventlogs\&.
911.RE
912.RS 4
913net eventlog export \- Export the samba internal tdb based representation
914of eventlogs into an eventlog *\&.evt file\&.
915.RE
916.SS "EVENTLOG DUMP filename"
917.PP
918Prints a eventlog *\&.evt file to standard output\&.
919.SS "EVENTLOG IMPORT filename eventlog"
920.PP
921Imports a eventlog *\&.evt file defined by
922\fIfilename\fR
923into the samba internal tdb representation of eventlog defined by
924\fIeventlog\fR\&.
925\fIeventlog\fR
926needs to part of the
927\fIeventlog list\fR
928defined in smb\&.conf\&. See the
929\fBsmb.conf\fR(5)
930manpage for details\&.
931.SS "EVENTLOG EXPORT filename eventlog"
932.PP
933Exports the samba internal tdb representation of eventlog defined by
934\fIeventlog\fR
935to a eventlog *\&.evt file defined by
936\fIfilename\fR\&.
937\fIeventlog\fR
938needs to part of the
939\fIeventlog list\fR
940defined in smb\&.conf\&. See the
941\fBsmb.conf\fR(5)
942manpage for details\&.
943.SS "DOM"
944.PP
945Starting 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\&.
946.PP
947In 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\&.
948.PP
949The client side support for remote join is implemented in the net dom commands which are:
950.RS 4
951net dom join \- Join a remote computer into a domain\&.
952.RE
953.RS 4
954net dom unjoin \- Unjoin a remote computer from a domain\&.
955.RE
956.RS 4
957net dom renamecomputer \- Renames a remote computer joined to a domain\&.
958.RE
959.SS "DOM JOIN domain=DOMAIN ou=OU account=ACCOUNT password=PASSWORD reboot"
960.PP
961Joins a computer into a domain\&. This command supports the following additional parameters:
962.sp
963.RS 4
964.ie n \{\
965\h'-04'\(bu\h'+03'\c
966.\}
967.el \{\
968.sp -1
969.IP \(bu 2.3
970.\}
971\fIDOMAIN\fR
972can 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
973\fIDOMAIN\fR
974parameter cannot be NULL\&.
975.RE
976.sp
977.RS 4
978.ie n \{\
979\h'-04'\(bu\h'+03'\c
980.\}
981.el \{\
982.sp -1
983.IP \(bu 2.3
984.\}
985\fIOU\fR
986can be set to a RFC 1779 LDAP DN, like
987\fIou=mymachines,cn=Users,dc=example,dc=com\fR
988in order to create the machine account in a non\-default LDAP containter\&. This optional parameter is only supported when joining Active Directory Domains\&.
989.RE
990.sp
991.RS 4
992.ie n \{\
993\h'-04'\(bu\h'+03'\c
994.\}
995.el \{\
996.sp -1
997.IP \(bu 2.3
998.\}
999\fIACCOUNT\fR
1000defines 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\&.
1001.RE
1002.sp
1003.RS 4
1004.ie n \{\
1005\h'-04'\(bu\h'+03'\c
1006.\}
1007.el \{\
1008.sp -1
1009.IP \(bu 2.3
1010.\}
1011\fIPASSWORD\fR
1012defines the password for the domain account defined with
1013\fIACCOUNT\fR\&.
1014.RE
1015.sp
1016.RS 4
1017.ie n \{\
1018\h'-04'\(bu\h'+03'\c
1019.\}
1020.el \{\
1021.sp -1
1022.IP \(bu 2.3
1023.\}
1024\fIREBOOT\fR
1025is an optional parameter that can be set to reboot the remote machine after successful join to the domain\&.
1026.sp
1027.RE
1028.PP
1029Note 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\&.
1030.PP
1031Example: net dom join \-S xp \-U XP\e\eadministrator%secret domain=MYDOM account=MYDOM\e\eadministrator password=topsecret reboot\&.
1032.PP
1033This 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\&.
1034.SS "DOM UNJOIN account=ACCOUNT password=PASSWORD reboot"
1035.PP
1036Unjoins a computer from a domain\&. This command supports the following additional parameters:
1037.sp
1038.RS 4
1039.ie n \{\
1040\h'-04'\(bu\h'+03'\c
1041.\}
1042.el \{\
1043.sp -1
1044.IP \(bu 2.3
1045.\}
1046\fIACCOUNT\fR
1047defines 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\&.
1048.RE
1049.sp
1050.RS 4
1051.ie n \{\
1052\h'-04'\(bu\h'+03'\c
1053.\}
1054.el \{\
1055.sp -1
1056.IP \(bu 2.3
1057.\}
1058\fIPASSWORD\fR
1059defines the password for the domain account defined with
1060\fIACCOUNT\fR\&.
1061.RE
1062.sp
1063.RS 4
1064.ie n \{\
1065\h'-04'\(bu\h'+03'\c
1066.\}
1067.el \{\
1068.sp -1
1069.IP \(bu 2.3
1070.\}
1071\fIREBOOT\fR
1072is an optional parameter that can be set to reboot the remote machine after successful unjoin from the domain\&.
1073.sp
1074.RE
1075.PP
1076Note 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\&.
1077.PP
1078Example: net dom unjoin \-S xp \-U XP\e\eadministrator%secret account=MYDOM\e\eadministrator password=topsecret reboot\&.
1079.PP
1080This 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\&.
1081.SS "DOM RENAMECOMPUTER newname=NEWNAME account=ACCOUNT password=PASSWORD reboot"
1082.PP
1083Renames a computer that is joined to a domain\&. This command supports the following additional parameters:
1084.sp
1085.RS 4
1086.ie n \{\
1087\h'-04'\(bu\h'+03'\c
1088.\}
1089.el \{\
1090.sp -1
1091.IP \(bu 2.3
1092.\}
1093\fINEWNAME\fR
1094defines the new name of the machine in the domain\&.
1095.RE
1096.sp
1097.RS 4
1098.ie n \{\
1099\h'-04'\(bu\h'+03'\c
1100.\}
1101.el \{\
1102.sp -1
1103.IP \(bu 2.3
1104.\}
1105\fIACCOUNT\fR
1106defines 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\&.
1107.RE
1108.sp
1109.RS 4
1110.ie n \{\
1111\h'-04'\(bu\h'+03'\c
1112.\}
1113.el \{\
1114.sp -1
1115.IP \(bu 2.3
1116.\}
1117\fIPASSWORD\fR
1118defines the password for the domain account defined with
1119\fIACCOUNT\fR\&.
1120.RE
1121.sp
1122.RS 4
1123.ie n \{\
1124\h'-04'\(bu\h'+03'\c
1125.\}
1126.el \{\
1127.sp -1
1128.IP \(bu 2.3
1129.\}
1130\fIREBOOT\fR
1131is an optional parameter that can be set to reboot the remote machine after successful rename in the domain\&.
1132.sp
1133.RE
1134.PP
1135Note 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\&.
1136.PP
1137Example: net dom renamecomputer \-S xp \-U XP\e\eadministrator%secret newname=XPNEW account=MYDOM\e\eadministrator password=topsecret reboot\&.
1138.PP
1139This 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\&.
1140.SS "G_LOCK"
1141.PP
1142Manage global locks\&.
1143.SS "G_LOCK DO lockname timeout command"
1144.PP
1145Execute 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
1146g_lock\&.tdb\&. In setups with CTDB running, the locking information will be available on all cluster nodes\&.
1147.sp
1148.RS 4
1149.ie n \{\
1150\h'-04'\(bu\h'+03'\c
1151.\}
1152.el \{\
1153.sp -1
1154.IP \(bu 2.3
1155.\}
1156\fILOCKNAME\fR
1157defines the name of the global lock\&.
1158.RE
1159.sp
1160.RS 4
1161.ie n \{\
1162\h'-04'\(bu\h'+03'\c
1163.\}
1164.el \{\
1165.sp -1
1166.IP \(bu 2.3
1167.\}
1168\fITIMEOUT\fR
1169defines the timeout\&.
1170.RE
1171.sp
1172.RS 4
1173.ie n \{\
1174\h'-04'\(bu\h'+03'\c
1175.\}
1176.el \{\
1177.sp -1
1178.IP \(bu 2.3
1179.\}
1180\fICOMMAND\fR
1181defines the shell command to execute\&.
1182.SS "G_LOCK LOCKS"
1183.PP
1184Print a list of all currently existing locknames\&.
1185.SS "G_LOCK DUMP lockname"
1186.PP
1187Dump the locking table of a certain global lock\&.
1188.SS "HELP [COMMAND]"
1189.PP
1190Gives usage information for the specified command\&.
1191.SH "VERSION"
1192.PP
1193This man page is complete for version 3 of the Samba suite\&.
1194.SH "AUTHOR"
1195.PP
1196The 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\&.
1197.PP
1198The net manpage was written by Jelmer Vernooij\&.
Note: See TracBrowser for help on using the repository browser.