mksmbcmnt Command
Purpose
Adds a Server Message Block (SMB) client mount point to the /etc/filesystems file and performs the mount operation.
Syntax
mksmbcmnt -f MountPoint -d RemoteShare -h ServerName -w wrkgrp
-c user [-p password] [-m MountTypeName]
[-A|-a] [-I|-B|-N]
[-t {rw|ro}] [-u uid] [-g gid] [-x fmode]
[-V {2.1|3.0.2|auto}] [-S {enabled|required}]
[-D {desired|required|disabled}] [-E {desired|required|disabled}] [-s spn]
Description
The mksmbcmnt command constructs an SMB client file system entry that is appended to the /etc/filesystems file. The mksmbcmnt command then mounts the SMB client file system. The mksmbcmnt command options are parsed and passed to the crfs command that adds the SMB entry to the /etc/filesystems file.
The default value for all the mount options (-t, -u, -g, -x, -w, -V, -S, -D, -E) is same as the mount command.
Flags
- -a
- Specifies that the new SMB entry for the SMB client mount point in the /etc/filesystems file must not be automatically mounted after the system restart. This is the default setting.
- -A
- Specifies that the new SMB entry for the SMB client mount point in the /etc/filesystems file must be automatically mounted after the system restart.
- -B
- Adds an entry to the /etc/filesystems file and attempts to mount the SMB client file system. This is the default setting.
- -c user
- Specifies the username that must be used to access the SMB share.
- -d RemoteShare
- Specifies the share name on the SMB server that must be mounted.
- -D {desired|required|disabled}
- Specifies whether the SMB client file system needs secure dialect negotiation capability. SMB
dialect 3.0.2 implements secure dialect negotiation capability to protect the SMB client against
security-downgrade attacks. The valid values are
desired
,required
, anddisabled
. - -E {desired|required|disabled}
- Specifies whether the SMB client file system requires data encryption. The valid values are
desired
,required
, anddisabled
. - -f MountPoint
- Specifies the path name in which the SMB share must be mounted.
- -g gid
- Specifies the group ID that is assigned to files in the SMB client mount point. The default value is 0.
- -h ServerName
- Specifies the name of the remote host or the SMB server. This argument can be specified as a hostname, an IP address, or as a fully qualified domain name.
- -I
- Adds the SMB client file system entry to the /etc/filesystems file but the directory is not mounted.
- -m MountTypeName
- Defines the mount type of the entry that is added to the /etc/filesystems file. The mount type determines whether specific file systems can be mounted by using the -t flag of the mount command. By default, the value of the mount type is not added to the /etc/filesystems file.
- -N
- Mounts the directory with the specified options but does not modify the /etc/filesystems file.
- -p password
- Specifies the password that is used to grant access to the specific user on the specific SMB server. The specific credentials (server name, username, and password) are added to the smbcred file. The password is encrypted. If the -p option is not specified, and the credentials do not exist in the smbcred file, the command-line prompts you to specify the password, and the credentials are added to the smbcred file. If the SMB server or user credentials exist in the smbcred file, this option is ignored, and the existing credentials are used for the mount operation.
- -s spn
- Specifies the service principal name (SPN) that must be used in the SMB client mount points. The format of the spn parameter is cifs/<smbServerHostName>, where smbServerHostName is the fully qualified domain name (FQDN) of the SMB server or the name that the Kerberos resolves as the SMB server. By default, SPN is constructed automatically by the SMB client file system as cifs/<smbServerHostName>.
- -t {rw|ro}
- Specifies whether the SMB client file system must be mounted as read-only.
- -u uid
- Specifies the user ID that is assigned to the files in the SMB client mount points.
- -x fmode
- Specifies the owner, group, and other permission bits that are assigned to the files in the SMB client mount points.
- -w wrkgrp
- Specifies the workgroup to which the SMB server belongs.
- -V {2.1|3.0.2|auto}
- Specifies the version of the SMB protocol that is used to communicate with the SMB server. The
valid values are
2.1
,3.0.2
, andauto
. - -S {enabled|required}
- Specifies whether the SMB client file system needs digital signature for communication with the
SMB server. The valid values are
enabled
andrequired
.
Exit status
- 0
- The command completed successfully.
- >0
- An error occurred.
Examples
- To add an SMB client file system entry over the
/mnt
mount point toshare1
SMB share onserver1
, and then authenticate asuser1
, enter the following command:mksmbcmnt -f /mnt -d share1 -h server1 -c user1
- To add an SMB client file system entry to the /etc/filesystems file and
mount an SMB client filesystem with default options, run the following
command:
This command prompts you to enter a password if the password is not already added in the /etc/smbcred file. If the mount operation fails, this command displays the output of the mount command. The changes in the /etc/filesystems file are retained.mksmbcmnt -f /mnt -d /share -h host.xyz.com -c braz2lpa2usr1 -w SMB_WRKGRP
- To add an SMB client file system entry to /etc/filesystems file and mount
an SMB client file system with the digital signatures set to required, run the following
command:
mksmbcmnt -f /mnt -d /share -h host.xyz.com -c braz2lpa2usr1 -w SMB_WRKGRP -S required
Location
/usr/sbin/mksmbcmnt
Files
- /etc/smbcred
- Stores the credentials of the SMB client file system.
- /etc/filesystems
- Stores the SMB client file system entry that contains the mount points.