The share command exports, or makes a resource available for mounting, through a remote file system of type FSType. If the option -F FSType is omitted, the first file system type listed in /etc/dfs/fstypes is used as default. For a description of NFS specific options, see share_nfs(1M). pathname is the pathname of the directory to be shared. When invoked with no arguments, share displays all shared file systems.
Specify the filesystem type.
The specific_options are used to control access of the shared resource. (See share_nfs(1M) for the NFS specific options.) They may be any of the following:
Allow (disallow) opens on character and block devices. The default is devices.
Note: In the Trusted Solaris environment, device special files are typically located only in the /dev and /devices directories in the root file system. All other file systems should be mounted with the nodevices option to prevent recognition of devices that may reside in any other directories.
Forced privileges on executables are allowed or disallowed. The default is priv.
pathname is shared read/write to all clients. This is also the default behavior.
pathname is shared read/write only to the listed clients. No other systems can access pathname.
pathname is shared read-only to all clients.
pathname is shared read-only only to the listed clients. No other systems can access pathname.
The -d flag may be used to provide a description of the resource being shared.
This line will share the /disk file system read-only at boot time.
share -F nfs -o ro /disk
When invoked with no option or with only the -F FSType option, the share command displays shared file systems. For all other cases, the command must be run with an effective UID of 0. If the shared
file is of the type NFS, then the
sys_nfs privilege is also required. If the file /etc/dfs/sharetab does not exist, this command will create it; therefore this command must be run at the sensitivity label
ADMIN_LOW. If the file /etc/dfs/sharetab exists, this command can be run at any other sensitivity label if it has the
file_mac_write privilege. To succeed in all cases, this command needs the
list of share commands to be executed at boot time
list of file system types, NFS by default
system record of shared file systems
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
Export (old terminology): file system sharing used to be called exporting on SunOS 4.x, so the share command used to be invoked as exportfs(1B) or /usr/sbin/exportfs.
If share commands are invoked multiple times on the same file system, the last share invocation supersedes the previous—the options set by the last share command replace the old options. For example, if read-write permission was given to usera on /somefs, then to give read-write permission also to userb on /somefs:
example% share -F nfs -o rw=usera:userb /somefs
This behavior is not limited to sharing the root file system, but applies to all file systems.