Creating, Editing, and Removing Shares
A share can be added using the
net rpc share
command capabilities.
The target machine may be local or remote and is specified by the -S option. It must be noted
that the addition and deletion of shares using this tool depends on the availability of a suitable
interface script. The interface scripts Sambas
smbd
uses are called
add share command,
delete share command and
change share command A set of example scripts are provided in the Samba source
code tarball in the directory ~samba/examples/scripts .
The following steps demonstrate the use of the share management capabilities of the
net
utility. In the first step a share called Bulge is added. The sharepoint within the
file system is the directory /data . The command that can be executed to perform the
addition of this share is shown here:
root# net rpc share add Bulge=/data -S MERLIN -Uroot%not24get
Validation is an important process, and by executing the command
net rpc share
with no other operators it is possible to obtain a listing of available shares, as shown here:
root# net rpc share -S MERLIN -Uroot%not24get
profdata
archive
Bulge <--- This one was added
print$
netlogon
profiles
IPC$
kyocera
ADMIN$
Often it is desirable also to permit a share to be removed using a command-line tool.
The following step permits the share that was previously added to be removed:
root# net rpc share delete Bulge -S MERLIN -Uroot%not24get
A simple validation shown here demonstrates that the share has been removed:
root# net rpc share -S MERLIN -Uroot%not24get
profdata
archive
print$
netlogon
profiles
IPC$
ADMIN$
kyocera
|