chcifsmnt Command

Purpose

Changes the mount options, server name, share, or credentials for a CIFS mount.

Syntax

chcifsmnt -f MountPoint [-d RemoteShare] [-h RemoteHost] [-c user] [-p password] [-m MountTypeName] [-A|-a] [-I|-B|-N] [-t {rw|ro}] [-u uid] [-g gid] [-x fmode] [-w wrkgrp]

Description

The chcifsmnt command changes the mount options, server name, share name, or credentials for a CIFS mount defined in /etc/filesystems file. If the share is not mounted, it will be mounted after the changes to the /etc/filesystems file are made. If the share is not already defined in /etc/filesystems, an error is returned.

Flags

Item Description
-a Specifies that the /etc/filesystems entry for this file system should not be automatically mounted at system restart. This is the default.
-A Specifies that the /etc/filesystems entry for this file system should be automatically mounted at system restart.
-B Specifies that the /etc/filesystems entry should be modified and that it should be remounted with the options specified. This is the default.
-c user Specifies user name used to gain access to the CIFS share.
-d RemoteShare Specifies the share name on the CIFS server that should be mounted.
-f MountPoint Specifies the path name over which the CIFS share should be mounted.
-g gid Specifies the GID that is assigned to files in the mount. The default is 0.
-h RemoteHost Specifies the name of the remote host (CIFS server). This can be provided as a host name, an IP address, or as a fully qualified domain name.
-I Specifies that the /etc/filesystems entry should be modified, but should not be remounted.
-m MountTypeName Defines the mount type that will be added to the /etc/filesystems file, which allows for mounting all file systems of a specific type using the -t option of the mount command. By default, no type value will be added to /etc/filesystems.
-N Remounts the CIFS share with the options specified, but does not modify the /etc/filesystems file.
-p password Specifies the password used to grant access to the specific user on the specific server. The specific credentials (server/user/password) are added to the cifscred file (the password will be encrypted). If the -p option is not specified, and the credentials do not already exist in the cifscred file, the command line prompts the user to provide the password, and the credentials will be added to the cifscred file. If the server/user credentials already exist in the cifscred file, this option is ignored, and the existing credentials are used for mounting.
-t {rw|ro} Specifies whether file system should be mounted as read-only. The default is read-write (rw).
-u uid Specifies the UID that is assigned to files in the mount. The default is 0.
-x fmode Specifies the owner, group, and other permission bits assigned to files in the mount. The default is 755.
-w wrkgrp Specifies the domain that should be used to authenticate the user during mount. If this option is not used, authentication is handled locally by the CIFS server.

Exit Status

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

Examples

  1. To change the user name to user1 for a CIFS mount defined on /mnt, enter:
    chcifsmnt -f /mnt -c user1 

Location

/usr/sbin/chcifsmnt

Files

Item Description
/etc/cifs_fs/cifscred Stores the CIFS credentials.
/etc/filesystems Stores the CIFS entry.