1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
6 <refentrytitle>net</refentrytitle>
7 <manvolnum>8</manvolnum>
8 <refmiscinfo class="source">Samba</refmiscinfo>
9 <refmiscinfo class="manual">System Administration tools</refmiscinfo>
10 <refmiscinfo class="version">3.2</refmiscinfo>
15 <refname>net</refname>
16 <refpurpose>Tool for administration of Samba and remote
23 <command>net</command>
24 <arg choice="req"><ads|rap|rpc></arg>
25 <arg choice="opt">-h</arg>
26 <arg choice="opt">-w workgroup</arg>
27 <arg choice="opt">-W myworkgroup</arg>
28 <arg choice="opt">-U user</arg>
29 <arg choice="opt">-I ip-address</arg>
30 <arg choice="opt">-p port</arg>
31 <arg choice="opt">-n myname</arg>
32 <arg choice="opt">-s conffile</arg>
33 <arg choice="opt">-S server</arg>
34 <arg choice="opt">-l</arg>
35 <arg choice="opt">-P</arg>
36 <arg choice="opt">-d debuglevel</arg>
37 <arg choice="opt">-V</arg>
42 <title>DESCRIPTION</title>
44 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
45 <manvolnum>7</manvolnum></citerefentry> suite.</para>
47 <para>The Samba net utility is meant to work just like the net utility
48 available for windows and DOS. The first argument should be used
49 to specify the protocol to use when executing a certain command.
50 ADS is used for ActiveDirectory, RAP is using for old (Win9x/NT3)
51 clients and RPC can be used for NT4 and Windows 2000. If this
52 argument is omitted, net will try to determine it automatically.
53 Not all commands are available on all protocols.
59 <title>OPTIONS</title>
65 <term>-w target-workgroup</term>
67 Sets target workgroup or domain. You have to specify
68 either this option or the IP address or the name of a server.
73 <term>-W workgroup</term>
75 Sets client workgroup or domain
87 <term>-I ip-address</term>
89 IP address of target server to use. You have to
90 specify either this option or a target workgroup or
98 Port on the target server to connect to (usually 139 or 445).
99 Defaults to trying 445 first, then 139.
103 &stdarg.netbios.name;
107 <term>-S server</term>
109 Name of target server. You should specify either
110 this option or a target workgroup or a target IP address.
117 When listing data, give more information on each item.
124 Make queries to the external server using the machine account of the local server.
128 &stdarg.server.debug;
133 <title>COMMANDS</title>
136 <title>CHANGESECRETPW</title>
138 <para>This command allows the Samba machine account password to be set from an external application
139 to a machine account password that has already been stored in Active Directory. DO NOT USE this command
140 unless you know exactly what you are doing. The use of this command requires that the force flag (-f)
141 be used also. There will be NO command prompt. Whatever information is piped into stdin, either by
142 typing at the command line or otherwise, will be stored as the literal machine password. Do NOT use
143 this without care and attention as it will overwrite a legitimate machine password without warning.
144 YOU HAVE BEEN WARNED.
152 <para>The <command>NET TIME</command> command allows you to view the time on a remote server
153 or synchronise the time on the local server with the time on the remote server.</para>
158 <para>Without any options, the <command>NET TIME</command> command
159 displays the time on the remote server.
165 <title>TIME SYSTEM</title>
167 <para>Displays the time on the remote server in a format ready for <command>/bin/date</command>.</para>
172 <title>TIME SET</title>
173 <para>Tries to set the date and time of the local server to that on
174 the remote server using <command>/bin/date</command>. </para>
179 <title>TIME ZONE</title>
181 <para>Displays the timezone in hours from GMT on the remote computer.</para>
187 <title>[RPC|ADS] JOIN [TYPE] [-U username[%password]] [createupn=UPN] [createcomputer=OU] [options]</title>
190 Join a domain. If the account already exists on the server, and
191 [TYPE] is MEMBER, the machine will attempt to join automatically.
192 (Assuming that the machine has been created in server manager)
193 Otherwise, a password will be prompted for, and a new account may
197 [TYPE] may be PDC, BDC or MEMBER to specify the type of server
202 [UPN] (ADS only) set the principalname attribute during the join. The default
203 format is host/netbiosname@REALM.
207 [OU] (ADS only) Precreate the computer account in a specific OU. The
208 OU string reads from top to bottom without RDNs, and is delimited by
209 a '/'. Please note that '\' is used for escape by both the shell
210 and ldap, so it may need to be doubled or quadrupled to pass through,
211 and it is not used as a delimiter.
216 <title>[RPC] OLDJOIN [options]</title>
218 <para>Join a domain. Use the OLDJOIN option to join the domain
219 using the old style of domain joining - you need to create a trust
220 account in server manager first.</para>
224 <title>[RPC|ADS] USER</title>
227 <title>[RPC|ADS] USER</title>
229 <para>List all users</para>
234 <title>[RPC|ADS] USER DELETE <replaceable>target</replaceable></title>
236 <para>Delete specified user</para>
241 <title>[RPC|ADS] USER INFO <replaceable>target</replaceable></title>
243 <para>List the domain groups of the specified user.</para>
248 <title>[RPC|ADS] USER RENAME <replaceable>oldname</replaceable> <replaceable>newname</replaceable></title>
250 <para>Rename specified user.</para>
255 <title>[RPC|ADS] USER ADD <replaceable>name</replaceable> [password] [-F user flags] [-C comment]</title>
257 <para>Add specified user.</para>
262 <title>[RPC|ADS] GROUP</title>
265 <title>[RPC|ADS] GROUP [misc options] [targets]</title>
266 <para>List user groups.</para>
270 <title>[RPC|ADS] GROUP DELETE <replaceable>name</replaceable> [misc. options]</title>
272 <para>Delete specified group.</para>
277 <title>[RPC|ADS] GROUP ADD <replaceable>name</replaceable> [-C comment]</title>
279 <para>Create specified group.</para>
285 <title>[RAP|RPC] SHARE</title>
288 <title>[RAP|RPC] SHARE [misc. options] [targets]</title>
290 <para>Enumerates all exported resources (network shares) on target server.</para>
295 <title>[RAP|RPC] SHARE ADD <replaceable>name=serverpath</replaceable> [-C comment] [-M maxusers] [targets]</title>
297 <para>Adds a share from a server (makes the export active). Maxusers
298 specifies the number of users that can be connected to the
299 share simultaneously.</para>
304 <title>SHARE DELETE <replaceable>sharename</replaceable></title>
306 <para>Delete specified share.</para>
311 <title>[RPC|RAP] FILE</title>
314 <title>[RPC|RAP] FILE</title>
316 <para>List all open files on remote server.</para>
321 <title>[RPC|RAP] FILE CLOSE <replaceable>fileid</replaceable></title>
323 <para>Close file with specified <replaceable>fileid</replaceable> on
324 remote server.</para>
329 <title>[RPC|RAP] FILE INFO <replaceable>fileid</replaceable></title>
332 Print information on specified <replaceable>fileid</replaceable>.
333 Currently listed are: file-id, username, locks, path, permissions.
339 <title>[RAP|RPC] FILE USER <replaceable>user</replaceable></title>
342 List files opened by specified <replaceable>user</replaceable>.
343 Please note that <command>net rap file user</command> does not work
344 against Samba servers.
352 <title>SESSION</title>
355 <title>RAP SESSION</title>
357 <para>Without any other options, SESSION enumerates all active SMB/CIFS
358 sessions on the target server.</para>
363 <title>RAP SESSION DELETE|CLOSE <replaceable>CLIENT_NAME</replaceable></title>
365 <para>Close the specified sessions.</para>
370 <title>RAP SESSION INFO <replaceable>CLIENT_NAME</replaceable></title>
372 <para>Give a list with all the open files in specified session.</para>
379 <title>RAP SERVER <replaceable>DOMAIN</replaceable></title>
381 <para>List all servers in specified domain or workgroup. Defaults
382 to local domain.</para>
387 <title>RAP DOMAIN</title>
389 <para>Lists all domains and workgroups visible on the
390 current network.</para>
395 <title>RAP PRINTQ</title>
398 <title>RAP PRINTQ INFO <replaceable>QUEUE_NAME</replaceable></title>
400 <para>Lists the specified print queue and print jobs on the server.
401 If the <replaceable>QUEUE_NAME</replaceable> is omitted, all
402 queues are listed.</para>
407 <title>RAP PRINTQ DELETE <replaceable>JOBID</replaceable></title>
409 <para>Delete job with specified id.</para>
416 <title>RAP VALIDATE <replaceable>user</replaceable> [<replaceable>password</replaceable>]</title>
419 Validate whether the specified user can log in to the
420 remote server. If the password is not specified on the commandline, it
429 <title>RAP GROUPMEMBER</title>
432 <title>RAP GROUPMEMBER LIST <replaceable>GROUP</replaceable></title>
434 <para>List all members of the specified group.</para>
439 <title>RAP GROUPMEMBER DELETE <replaceable>GROUP</replaceable> <replaceable>USER</replaceable></title>
441 <para>Delete member from group.</para>
446 <title>RAP GROUPMEMBER ADD <replaceable>GROUP</replaceable> <replaceable>USER</replaceable></title>
448 <para>Add member to group.</para>
455 <title>RAP ADMIN <replaceable>command</replaceable></title>
457 <para>Execute the specified <replaceable>command</replaceable> on
458 the remote server. Only works with OS/2 servers.
466 <title>RAP SERVICE</title>
469 <title>RAP SERVICE START <replaceable>NAME</replaceable> [arguments...]</title>
471 <para>Start the specified service on the remote server. Not implemented yet.</para>
478 <title>RAP SERVICE STOP</title>
480 <para>Stop the specified service on the remote server.</para>
489 <title>RAP PASSWORD <replaceable>USER</replaceable> <replaceable>OLDPASS</replaceable> <replaceable>NEWPASS</replaceable></title>
492 Change password of <replaceable>USER</replaceable> from <replaceable>OLDPASS</replaceable> to <replaceable>NEWPASS</replaceable>.
498 <title>LOOKUP</title>
501 <title>LOOKUP HOST <replaceable>HOSTNAME</replaceable> [<replaceable>TYPE</replaceable>]</title>
504 Lookup the IP address of the given host with the specified type (netbios suffix).
505 The type defaults to 0x20 (workstation).
511 <title>LOOKUP LDAP [<replaceable>DOMAIN</replaceable>]</title>
513 <para>Give IP address of LDAP server of specified <replaceable>DOMAIN</replaceable>. Defaults to local domain.</para>
518 <title>LOOKUP KDC [<replaceable>REALM</replaceable>]</title>
520 <para>Give IP address of KDC for the specified <replaceable>REALM</replaceable>.
521 Defaults to local realm.</para>
526 <title>LOOKUP DC [<replaceable>DOMAIN</replaceable>]</title>
528 <para>Give IP's of Domain Controllers for specified <replaceable>
529 DOMAIN</replaceable>. Defaults to local domain.</para>
534 <title>LOOKUP MASTER <replaceable>DOMAIN</replaceable></title>
536 <para>Give IP of master browser for specified <replaceable>DOMAIN</replaceable>
537 or workgroup. Defaults to local domain.</para>
546 <para>Samba uses a general caching interface called 'gencache'. It
547 can be controlled using 'NET CACHE'.</para>
549 <para>All the timeout parameters support the suffixes:
552 <member>s - Seconds</member>
553 <member>m - Minutes</member>
554 <member>h - Hours</member>
555 <member>d - Days</member>
556 <member>w - Weeks</member>
562 <title>CACHE ADD <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable></title>
564 <para>Add specified key+data to the cache with the given timeout.</para>
569 <title>CACHE DEL <replaceable>key</replaceable></title>
571 <para>Delete key from the cache.</para>
576 <title>CACHE SET <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable></title>
578 <para>Update data of existing cache entry.</para>
583 <title>CACHE SEARCH <replaceable>PATTERN</replaceable></title>
585 <para>Search for the specified pattern in the cache data.</para>
590 <title>CACHE LIST</title>
593 List all current items in the cache.
599 <title>CACHE FLUSH</title>
601 <para>Remove all the current items from the cache.</para>
608 <title>GETLOCALSID [DOMAIN]</title>
610 <para>Prints the SID of the specified domain, or if the parameter is
611 omitted, the SID of the local server.</para>
616 <title>SETLOCALSID S-1-5-21-x-y-z</title>
618 <para>Sets SID for the local server to the specified SID.</para>
623 <title>GETDOMAINSID</title>
625 <para>Prints the local machine SID and the SID of the current
631 <title>SETDOMAINSID</title>
633 <para>Sets the SID of the current domain.</para>
638 <title>GROUPMAP</title>
640 <para>Manage the mappings between Windows group SIDs and UNIX groups.
641 Common options include:</para>
644 <listitem><para>unixgroup - Name of the UNIX group</para></listitem>
645 <listitem><para>ntgroup - Name of the Windows NT group (must be
646 resolvable to a SID</para></listitem>
647 <listitem><para>rid - Unsigned 32-bit integer</para></listitem>
648 <listitem><para>sid - Full SID in the form of "S-1-..."</para></listitem>
649 <listitem><para>type - Type of the group; either 'domain', 'local',
650 or 'builtin'</para></listitem>
651 <listitem><para>comment - Freeform text description of the group</para></listitem>
655 <title>GROUPMAP ADD</title>
658 Add a new group mapping entry:
660 net groupmap add {rid=int|sid=string} unixgroup=string \
661 [type={domain|local}] [ntgroup=string] [comment=string]
668 <title>GROUPMAP DELETE</title>
670 <para>Delete a group mapping entry. If more than one group name matches, the first entry found is deleted.</para>
672 <para>net groupmap delete {ntgroup=string|sid=SID}</para>
677 <title>GROUPMAP MODIFY</title>
679 <para>Update en existing group entry.</para>
683 net groupmap modify {ntgroup=string|sid=SID} [unixgroup=string] \
684 [comment=string] [type={domain|local}]
690 <title>GROUPMAP LIST</title>
692 <para>List existing group mapping entries.</para>
694 <para>net groupmap list [verbose] [ntgroup=string] [sid=SID]</para>
702 <title>MAXRID</title>
704 <para>Prints out the highest RID currently in use on the local
705 server (by the active 'passdb backend').
711 <title>RPC INFO</title>
713 <para>Print information about the domain of the remote server,
714 such as domain name, domain sid and number of users and groups.
720 <title>[RPC|ADS] TESTJOIN</title>
722 <para>Check whether participation in a domain is still valid.</para>
727 <title>[RPC|ADS] CHANGETRUSTPW</title>
729 <para>Force change of domain trust password.</para>
734 <title>RPC TRUSTDOM</title>
737 <title>RPC TRUSTDOM ADD <replaceable>DOMAIN</replaceable></title>
739 <para>Add a interdomain trust account for <replaceable>DOMAIN</replaceable>.
740 This is in fact a Samba account named <replaceable>DOMAIN$</replaceable>
741 with the account flag <constant>'I'</constant> (interdomain trust account).
742 If the command is used against localhost it has the same effect as
743 <command>smbpasswd -a -i DOMAIN</command>. Please note that both commands
744 expect a appropriate UNIX account.
750 <title>RPC TRUSTDOM DEL <replaceable>DOMAIN</replaceable></title>
752 <para>Remove interdomain trust account for
753 <replaceable>DOMAIN</replaceable>. If it is used against localhost
754 it has the same effect as <command>smbpasswd -x DOMAIN$</command>.
760 <title>RPC TRUSTDOM ESTABLISH <replaceable>DOMAIN</replaceable></title>
763 Establish a trust relationship to a trusting domain.
764 Interdomain account must already be created on the remote PDC.
770 <title>RPC TRUSTDOM REVOKE <replaceable>DOMAIN</replaceable></title>
771 <para>Abandon relationship to trusted domain</para>
776 <title>RPC TRUSTDOM LIST</title>
778 <para>List all current interdomain trust relationships.</para>
783 <title>RPC RIGHTS</title>
785 <para>This subcommand is used to view and manage Samba's rights assignments (also
786 referred to as privileges). There are three options currently available:
787 <parameter>list</parameter>, <parameter>grant</parameter>, and
788 <parameter>revoke</parameter>. More details on Samba's privilege model and its use
789 can be found in the Samba-HOWTO-Collection.</para>
797 <title>RPC ABORTSHUTDOWN</title>
799 <para>Abort the shutdown of a remote server.</para>
804 <title>RPC SHUTDOWN [-t timeout] [-r] [-f] [-C message]</title>
806 <para>Shut down the remote server.</para>
812 Reboot after shutdown.
819 Force shutting down all applications.
824 <term>-t timeout</term>
826 Timeout before system will be shut down. An interactive
827 user of the system can use this time to cancel the shutdown.
832 <term>-C message</term>
833 <listitem><para>Display the specified message on the screen to
834 announce the shutdown.</para></listitem>
841 <title>RPC SAMDUMP</title>
843 <para>Print out sam database of remote server. You need
844 to run this against the PDC, from a Samba machine joined as a BDC. </para>
848 <title>RPC VAMPIRE</title>
850 <para>Export users, aliases and groups from remote server to
851 local server. You need to run this against the PDC, from a Samba machine joined as a BDC.
856 <title>RPC VAMPIRE KEYTAB</title>
858 <para>Dump remote SAM database to local Kerberos keytab file.
863 <title>RPC VAMPIRE LDIF</title>
865 <para>Dump remote SAM database to local LDIF file or standard output.
870 <title>RPC GETSID</title>
872 <para>Fetch domain SID and store it in the local <filename>secrets.tdb</filename>. </para>
877 <title>ADS LEAVE</title>
879 <para>Make the remote host leave the domain it is part of. </para>
884 <title>ADS STATUS</title>
886 <para>Print out status of machine account of the local machine in ADS.
887 Prints out quite some debug info. Aimed at developers, regular
888 users should use <command>NET ADS TESTJOIN</command>.</para>
893 <title>ADS PRINTER</title>
896 <title>ADS PRINTER INFO [<replaceable>PRINTER</replaceable>] [<replaceable>SERVER</replaceable>]</title>
899 Lookup info for <replaceable>PRINTER</replaceable> on <replaceable>SERVER</replaceable>. The printer name defaults to "*", the
900 server name defaults to the local host.</para>
905 <title>ADS PRINTER PUBLISH <replaceable>PRINTER</replaceable></title>
907 <para>Publish specified printer using ADS.</para>
912 <title>ADS PRINTER REMOVE <replaceable>PRINTER</replaceable></title>
914 <para>Remove specified printer from ADS directory.</para>
921 <title>ADS SEARCH <replaceable>EXPRESSION</replaceable> <replaceable>ATTRIBUTES...</replaceable></title>
923 <para>Perform a raw LDAP search on a ADS server and dump the results. The
924 expression is a standard LDAP search expression, and the
925 attributes are a list of LDAP fields to show in the results.</para>
927 <para>Example: <userinput>net ads search '(objectCategory=group)' sAMAccountName</userinput>
933 <title>ADS DN <replaceable>DN</replaceable> <replaceable>(attributes)</replaceable></title>
936 Perform a raw LDAP search on a ADS server and dump the results. The
937 DN standard LDAP DN, and the attributes are a list of LDAP fields
938 to show in the result.
941 <para>Example: <userinput>net ads dn 'CN=administrator,CN=Users,DC=my,DC=domain' SAMAccountName</userinput></para>
946 <title>ADS WORKGROUP</title>
948 <para>Print out workgroup name for specified kerberos realm.</para>
953 <title>SAM CREATEBUILTINGROUP <NAME></title>
956 (Re)Create a BUILTIN group.
957 Only a wellknown set of BUILTIN groups can be created with this command.
958 This is the list of currently recognized group names: Administrators,
959 Users, Guests, Power Users, Account Operators, Server Operators, Print
960 Operators, Backup Operators, Replicator, RAS Servers, Pre-Windows 2000
963 This command requires a running Winbindd with idmap allocation properly
964 configured. The group gid will be allocated out of the winbindd range.
970 <title>SAM CREATELOCALGROUP <NAME></title>
973 Create a LOCAL group (also known as Alias).
975 This command requires a running Winbindd with idmap allocation properly
976 configured. The group gid will be allocated out of the winbindd range.
982 <title>SAM DELETELOCALGROUP <NAME></title>
985 Delete an existing LOCAL group (also known as Alias).
992 <title>SAM MAPUNIXGROUP <NAME></title>
995 Map an existing Unix group and make it a Domain Group, the domain group
996 will have the same name.
1002 <title>SAM UNMAPUNIXGROUP <NAME></title>
1005 Remove an existing group mapping entry.
1011 <title>SAM ADDMEM <GROUP> <MEMBER></title>
1014 Add a member to a Local group. The group can be specified only by name,
1015 the member can be specified by name or SID.
1021 <title>SAM DELMEM <GROUP> <MEMBER></title>
1024 Remove a member from a Local group. The group and the member must be
1031 <title>SAM LISTMEM <GROUP></title>
1034 List Local group members. The group must be specified by name.
1040 <title>SAM LIST <users|groups|localgroups|builtin|workstations> [verbose]</title>
1043 List the specified set of accounts by name. If verbose is specified,
1044 the rid and description is also provided for each account.
1050 <title>SAM SHOW <NAME></title>
1053 Show the full DOMAIN\\NAME the SID and the type for the corresponding
1060 <title>SAM SET HOMEDIR <NAME> <DIRECTORY></title>
1063 Set the home directory for a user account.
1069 <title>SAM SET PROFILEPATH <NAME> <PATH></title>
1072 Set the profile path for a user account.
1078 <title>SAM SET COMMENT <NAME> <COMMENT></title>
1081 Set the comment for a user or group account.
1087 <title>SAM SET FULLNAME <NAME> <FULL NAME></title>
1090 Set the full name for a user account.
1096 <title>SAM SET LOGONSCRIPT <NAME> <SCRIPT></title>
1099 Set the logon script for a user account.
1105 <title>SAM SET HOMEDRIVE <NAME> <DRIVE></title>
1108 Set the home drive for a user account.
1114 <title>SAM SET WORKSTATIONS <NAME> <WORKSTATIONS></title>
1117 Set the workstations a user account is allowed to log in from.
1123 <title>SAM SET DISABLE <NAME></title>
1126 Set the "disabled" flag for a user account.
1132 <title>SAM SET PWNOTREQ <NAME></title>
1135 Set the "password not required" flag for a user account.
1141 <title>SAM SET AUTOLOCK <NAME></title>
1144 Set the "autolock" flag for a user account.
1150 <title>SAM SET PWNOEXP <NAME></title>
1153 Set the "password do not expire" flag for a user account.
1159 <title>SAM SET PWDMUSTCHANGENOW <NAME> [yes|no]</title>
1162 Set or unset the "password must change" flag for a user account.
1168 <title>SAM POLICY LIST</title>
1171 List the available account policies.
1177 <title>SAM POLICY SHOW <account policy></title>
1180 Show the account policy value.
1186 <title>SAM POLICY SET <account policy> <value></title>
1189 Set a value for the account policy.
1190 Valid values can be: "forever", "never", "off", or a number.
1196 <title>SAM PROVISION</title>
1199 Only available if ldapsam:editposix is set and winbindd is running.
1200 Properly populates the ldap tree with the basic accounts (Administrator)
1201 and groups (Domain Users, Domain Admins, Domain Guests) on the ldap tree.
1207 <title>IDMAP DUMP <local tdb file name></title>
1210 Dumps the mappings contained in the local tdb file specified.
1211 This command is useful to dump only the mappings produced by the idmap_tdb backend.
1217 <title>IDMAP RESTORE [input file]</title>
1220 Restore the mappings from the specified file or stdin.
1226 <title>IDMAP SECRET <DOMAIN>|ALLOC <secret></title>
1229 Store a secret for the specified domain, used primarily for domains
1230 that use idmap_ldap as a backend. In this case the secret is used
1231 as the password for the user DN used to bind to the ldap server.
1237 <title>USERSHARE</title>
1239 <para>Starting with version 3.0.23, a Samba server now supports the ability for
1240 non-root users to add user defined shares to be exported using the "net usershare"
1245 To set this up, first set up your smb.conf by adding to the [global] section:
1247 usershare path = /usr/local/samba/lib/usershares
1249 Next create the directory /usr/local/samba/lib/usershares, change the owner to root and
1250 set the group owner to the UNIX group who should have the ability to create usershares,
1251 for example a group called "serverops".
1253 Set the permissions on /usr/local/samba/lib/usershares to 01770.
1255 (Owner and group all access, no access for others, plus the sticky bit,
1256 which means that a file in that directory can be renamed or deleted only
1257 by the owner of the file).
1259 Finally, tell smbd how many usershares you will allow by adding to the [global]
1260 section of smb.conf a line such as :
1262 usershare max shares = 100.
1264 To allow 100 usershare definitions. Now, members of the UNIX group "serverops"
1265 can create user defined shares on demand using the commands below.
1268 <para>The usershare commands are:
1271 <member>net usershare add sharename path [comment] [acl] [guest_ok=[y|n]] - to add or change a user defined share.</member>
1272 <member>net usershare delete sharename - to delete a user defined share.</member>
1273 <member>net usershare info [-l|--long] [wildcard sharename] - to print info about a user defined share.</member>
1274 <member>net usershare list [-l|--long] [wildcard sharename] - to list user defined shares.</member>
1280 <title>USERSHARE ADD <replaceable>sharename</replaceable> <replaceable>path</replaceable> <replaceable>[comment]</replaceable> <replaceable>[acl]</replaceable> <replaceable>[guest_ok=[y|n]]</replaceable></title>
1283 Add or replace a new user defined share, with name "sharename".
1287 "path" specifies the absolute pathname on the system to be exported.
1288 Restrictions may be put on this, see the global smb.conf parameters:
1289 "usershare owner only", "usershare prefix allow list", and
1290 "usershare prefix deny list".
1294 The optional "comment" parameter is the comment that will appear
1295 on the share when browsed to by a client.
1298 <para>The optional "acl" field
1299 specifies which users have read and write access to the entire share.
1300 Note that guest connections are not allowed unless the smb.conf parameter
1301 "usershare allow guests" has been set. The definition of a user
1302 defined share acl is: "user:permission", where user is a valid
1303 username on the system and permission can be "F", "R", or "D".
1304 "F" stands for "full permissions", ie. read and write permissions.
1305 "D" stands for "deny" for a user, ie. prevent this user from accessing
1307 "R" stands for "read only", ie. only allow read access to this
1308 share (no creation of new files or directories or writing to files).
1312 The default if no "acl" is given is "Everyone:R", which means any
1313 authenticated user has read-only access.
1317 The optional "guest_ok" has the same effect as the parameter of the
1318 same name in smb.conf, in that it allows guest access to this user
1319 defined share. This parameter is only allowed if the global parameter
1320 "usershare allow guests" has been set to true in the smb.conf.
1323 There is no separate command to modify an existing user defined share,
1324 just use the "net usershare add [sharename]" command using the same
1325 sharename as the one you wish to modify and specify the new options
1326 you wish. The Samba smbd daemon notices user defined share modifications
1327 at connect time so will see the change immediately, there is no need
1328 to restart smbd on adding, deleting or changing a user defined share.
1332 <title>USERSHARE DELETE <replaceable>sharename</replaceable></title>
1335 Deletes the user defined share by name. The Samba smbd daemon
1336 immediately notices this change, although it will not disconnect
1337 any users currently connected to the deleted share.
1343 <title>USERSHARE INFO <replaceable>[-l|--long]</replaceable> <replaceable>[wildcard sharename]</replaceable></title>
1346 Get info on user defined shares owned by the current user matching the given pattern, or all users.
1350 net usershare info on its own dumps out info on the user defined shares that were
1351 created by the current user, or restricts them to share names that match the given
1352 wildcard pattern ('*' matches one or more characters, '?' matches only one character).
1353 If the '-l' or '--long' option is also given, it prints out info on user defined
1354 shares created by other users.
1358 The information given about a share looks like:
1363 usershare_acl=Everyone:F
1366 And is a list of the current settings of the user defined share that can be
1367 modified by the "net usershare add" command.
1373 <title>USERSHARE LIST <replaceable>[-l|--long]</replaceable> <replaceable>wildcard sharename</replaceable></title>
1376 List all the user defined shares owned by the current user matching the given pattern, or all users.
1380 net usershare list on its own list out the names of the user defined shares that were
1381 created by the current user, or restricts the list to share names that match the given
1382 wildcard pattern ('*' matches one or more characters, '?' matches only one character).
1383 If the '-l' or '--long' option is also given, it includes the names of user defined
1384 shares created by other users.
1394 <para>Starting with version 3.2.0, a Samba server can be configured by data
1395 stored in registry. This configuration data can be edited with the new "net
1400 The deployment of this configuration data can be activated in two levels from the
1401 <emphasis>smb.conf</emphasis> file: Share definitions from registry are
1402 activated by setting <parameter>registry shares</parameter> to
1403 <quote>yes</quote> in the [global] section and global configuration options are
1404 activated by setting <smbconfoption name="include">registry</smbconfoption> in
1405 the [global] section for a mixed configuration or by setting
1406 <smbconfoption name="config backend">registry</smbconfoption> in the [global]
1407 section for a registry-only configuration.
1408 See the <citerefentry><refentrytitle>smb.conf</refentrytitle>
1409 <manvolnum>5</manvolnum></citerefentry> manpage for details.
1412 <para>The conf commands are:
1414 <member>net conf list - Dump the complete configuration in smb.conf like
1416 <member>net conf import - Import configuration from file in smb.conf
1418 <member>net conf listshares - List the registry shares.</member>
1419 <member>net conf drop - Delete the complete configuration from
1421 <member>net conf showshare - Show the definition of a registry share.</member>
1422 <member>net conf addshare - Create a new registry share.</member>
1423 <member>net conf delshare - Delete a registry share.</member>
1424 <member>net conf setparm - Store a parameter.</member>
1425 <member>net conf getparm - Retrieve the value of a parameter.</member>
1426 <member>net conf delparm - Delete a parameter.</member>
1427 <member>net conf getincludes - Show the includes of a share definition.</member>
1428 <member>net conf setincludes - Set includes for a share.</member>
1429 <member>net conf delincludes - Delete includes from a share definition.</member>
1434 <title>CONF LIST</title>
1437 Print the configuration data stored in the registry in a smb.conf-like format to
1443 <title>CONF IMPORT <replaceable>[--test|-T]</replaceable> <replaceable>filename</replaceable> <replaceable>[section]</replaceable></title>
1446 This command imports configuration from a file in smb.conf format.
1447 If a section encountered in the input file is present in registry,
1448 its contents is replaced. Sections of registry configuration that have
1449 no counterpart in the input file are not affected. If you want to delete these,
1450 you will have to use the "net conf drop" or "net conf delshare" commands.
1451 Optionally, a section may be specified to restrict the effect of the
1452 import command to that specific section. A test mode is enabled by specifying
1453 the parameter "-T" on the commandline. In test mode, no changes are made to the
1454 registry, and the resulting configuration is printed to standard output instead.
1459 <title>CONF LISTSHARES</title>
1462 List the names of the shares defined in registry.
1467 <title>CONF DROP</title>
1470 Delete the complete configuration data from registry.
1475 <title>CONF SHOWSHARE <replaceable>sharename</replaceable></title>
1478 Show the definition of the share or section specified. It is valid to specify
1479 "global" as sharename to retrieve the global configuration options from
1485 <title>CONF ADDSHARE <replaceable>sharename</replaceable> <replaceable>path</replaceable> [<replaceable>writeable={y|N}</replaceable> [<replaceable>guest_ok={y|N}</replaceable> [<replaceable>comment</replaceable>]]] </title>
1487 <para>Create a new share definition in registry.
1488 The sharename and path have to be given. The share name may
1489 <emphasis>not</emphasis> be "global". Optionally, values for the very
1490 common options "writeable", "guest ok" and a "comment" may be specified.
1491 The same result may be obtained by a sequence of "net conf setparm"
1497 <title>CONF DELSHARE <replaceable>sharename</replaceable></title>
1500 Delete a share definition from registry.
1505 <title>CONF SETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable> <replaceable>value</replaceable></title>
1508 Store a parameter in registry. The section may be global or a sharename.
1509 The section is created if it does not exist yet.
1514 <title>CONF GETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
1517 Show a parameter stored in registry.
1522 <title>CONF DELPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
1525 Delete a parameter stored in registry.
1530 <title>CONF GETINCLUDES <replaceable>section</replaceable></title>
1533 Get the list of includes for the provided section (global or share).
1537 Note that due to the nature of the registry database and the nature of include directives,
1538 the includes need special treatment: Parameters are stored in registry by the parameter
1539 name as valuename, so there is only ever one instance of a parameter per share.
1540 Also, a specific order like in a text file is not guaranteed. For all real
1541 parameters, this is perfectly ok, but the include directive is rather a meta
1542 parameter, for which, in the smb.conf text file, the place where it is specified
1543 between the other parameters is very important. This can not be achieved by the
1544 simple registry smbconf data model, so there is one ordered list of includes
1545 per share, and this list is evaluated after all the parameters of the share.
1549 Further note that currently, only files can be included from registry
1550 configuration. In the future, there will be the ability to include configuration
1551 data from other registry keys.
1556 <title>CONF SETINCLUDES <replaceable>section</replaceable> [<replaceable>filename</replaceable>]+</title>
1559 Set the list of includes for the provided section (global or share) to the given
1560 list of one or more filenames. The filenames may contain the usual smb.conf
1566 <title>CONF DELINCLUDES <replaceable>section</replaceable></title>
1569 Delete the list of includes from the provided section (global or share).
1576 <title>HELP [COMMAND]</title>
1578 <para>Gives usage information for the specified command.</para>
1585 <title>VERSION</title>
1587 <para>This man page is complete for version 3 of the Samba
1592 <title>AUTHOR</title>
1594 <para>The original Samba software and related utilities
1595 were created by Andrew Tridgell. Samba is now developed
1596 by the Samba Team as an Open Source project similar
1597 to the way the Linux kernel is developed.</para>
1599 <para>The net manpage was written by Jelmer Vernooij.</para>