mount_smbfs |
mount_smbfs { -h -v } mount_smbfs [-u username_or_ID ] [-g groupname_or_ID ] [-f mode ] [-d mode ] [-I hostname_or_IP ] [-n long] [-N] [-U username ] [-W workgroup_name ] [-O c_user [: c_group ]/ s_user [: s_group ]] [-M c_mode [/ s_mode ]] [-R num_retries ] [-T timeout ] [-o mount_options ] [-x max_mounts ] //[ workgroup ;][ username [: password ]@] smb_server [/ share_name ] mount_point |
Mounts Server Message Block (SMB) shares as filesystem volumes . It takes a share UNC and a mount point as arguments.
mount_smbfs can make use of the same configuration files used by smbutil : either .nsmbrc in the user 's home directory, or the global /usr/local/etc/nsmb.conf , which overrides per-user files. The following example .nsmbrc demonstrates some of the parameters available:
[default] username=leonvs # NetBIOS name server nbns=192.168.1.3 [VAMANA] # server IP address addr=192.168.1.6 workgroup=TEST [VAMANA:LEONVS] password= $8465324253e0c07
The file consists of sections, each with a heading in brackets. Besides the [default] section, headings have a server name to which the parameters in the section apply, and can also include a username and a share name.
|
All sections and parameter definitions in .nsmbrc are optional; everything can be specified right on the mount_smbfs command line. This option may come in handy for providing passwords for automated connections, when prompting for a password (which is the most secure method of providing it) is impractical . The value of the password parameter can be a cleartext password, but it's derived from the output of smbutil crypt password in this example. While this is better than cleartext, don't trust the encryption too much, as it's fairly weak. Make sure you restrict permissions on .nsmbrc to prevent anyone from reading your passwords.
Specifies directory permissions on the mounted volume, which default to the same as file permissions, plus an execute bit whenever a read bit is set. The argument is an octal mode, as described in the chmod manpage .
Specifies file permissions on the mounted volume, which default to the same as those set on the mount point. The argument is an octal mode, as described in the chmod manpage.
Specifies group ownership for files and directories on the mounted volume, which defaults to the same as that set on the mount point.
Prints a brief usage statement to standard error.
Avoids NetBIOS name resolution, connecting directly to the hostname or IP address specified as an argument.
Assigns access rights to the SMB connection.
With an argument of long , disables support for long filenames, restricting them to the "8.3" naming standard.
Suppresses the prompt for a password. Unless a password is specified in a configuration file, authentication will fail for non-guest users.
Takes - o options, as listed in the mount manpage.
Assigns owner attributes to the SMB connection.
Specifies the number of times to retry a mount attempt. The default is 4 .
Specifies the connection request timeout (in seconds). The default is 15 .
Specifies ownership for files and directories on the mounted volume, which defaults to the same as that set on the mount point.
Specifies a username for authentication. This may also be part of the UNC.
Prints software version to standard error.
Specifies an SMB workgroup or NT domain for authentication. This may also be part of the UNC.
Automatically mounts all shares from the SMB server. The argument specifies a maximum number of shares that mount_smbfs is willing to mount from a server, to forestall resource starvation when the server has a very large number of shares. If the server has more shares than max_mounts , the mount attempt is cancelled.
The name of the SMB workgroup or NT domain to use for authentication to the SMB server.
The name to use for authentication to the SMB server.
The password to use for authentication. Note that specifying this option on the command line exposes the password in a process listing.
The NetBIOS name of an SMB server.
The name of the SMB share you wish to access.
The directory on which the filesystem will be mounted.
/sbin