start of change

chsmbcmnt Command

Purpose

Changes the mount options, server name, share name, or credentials of a Server Message Block (SMB) client mount point.

Syntax

chsmbcmnt -f MountPoint [-d RemoteShare] [-h ServerName] 
-c user [-p password] [-m MountTypeName] 
[-A|-a] [-I|-B|-N] 
[-t {rw|ro}] [-u uid] [-g gid] [-x fmode] 
[-w wrkgrp] [-V {2.1|3.0.2|auto}] [-S {enabled|required}] 
[-D {desired|required|disabled}] [-E {desired|required|disabled}] [-s spn]

Description

The chsmbcmnt command changes the mount options, server name, share name, or credentials for an SMB client mount point that are defined in the /etc/filesystems file. If the SMB share is not mounted, the SMB share is mounted after the /etc/filesystems file is changed. If the SMB share is already mounted, the command attempts to unmount it and remount with the new options, and the /etc/filesystems file is changed. If the SMB share is not already defined in the /etc/filesystems file, an error is returned.

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 client file system 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 client file system entry for the SMB client mount point in the /etc/filesystems file must be automatically mounted after the system restart.
-B
Changes the SMB client file system entry in the /etc/filesystems file and attempts to remount the SMB client file system by using the specified flags and parameters. 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 requires 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, and disabled.
-E {desired|required|disabled}
Specifies whether the SMB client file system requires data encryption capability. The valid values are desired, required, and disabled.
-f MountPoint
Specifies the path name in which the SMB share must be mounted.
-g gid
Specifies the group ID that is assigned to the 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
Changes the SMB client file system entry in the /etc/filesystems file but does not remount the directory.
-m MountTypeName
Defines the mount type of the SMB client file system 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 server or user credentials already exist in the smbcred file, the command modifies the credentials in the smbcred file with the new credentials that are specified by using this option.
-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 files in the mount points.
-x fmode
Specifies the owner, group, and other permission bits that are assigned to the files in the 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, and auto.
-S {enabled|required}
Specifies whether the SMB client file system needs digital signature for communication with the SMB server. The valid values are enabled and required.

Exit status

0
The command completed successfully.
>0
An error occurred.

Examples

  • To change the username to user1 for an SMB client mount point that is defined in the /mnt mount point, enter the following command:
    chsmbcmnt -f /mnt -c user1
  • To change an SMB client file system entry in the /etc/filesystems file and remount the SMB client file system with the changed options, run the following command:
    chsmbcmnt -f /mnt -S enabled -E disabled
    This command changes the SMB client file system entry for the /mnt mount point in the /etc/filesystems file with the signing parameter set to enabled and the encryption parameter set to disabled, and then attempts to remount the file systems. If the mount operation fails, this command displays the output of the mount command. The changes in the /etc/filesystems file are retained.

Location

/usr/sbin/chsmbcmnt

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.
end of change