mkcifscred Command

Purpose

Adds CIFS credentials to the /etc/cifs_fs/cifscred file to allow future mounting of CIFS shares with stored credentials.

Syntax

mkcifscred -h RemoteHost -u user [-p password]

Description

The mkcifscred command takes a server and user name as input, and prompts for a password. The password is encrypted, and the credentials are stored in the cifscred file. If the password is not passed in with the -p option when mounting to a CIFS server, the credentials are either retrieved from the cifscred file, or, if the credentials do not exist in cifscred, the password is prompted for and read in as hidden input.

The credentials are stored as a server/user/password set. Multiple sets of credentials for the same server are permitted with different user names. Multiple sets with the same user name on different servers are also permitted.

Flags

Item Description
-h RemoteHost Specifies the name of the remote host (CIFS server). This can be provided as a host name, an IP address, or a fully qualified domain name.
-p password Specifies the password for a particular user on a particular remote host.
-u user Specifies the user name whose credentials are being defined for access to the given remote host.

Exit Status

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

Examples

  1. To add credentials for user1 to mount on server1, enter:
    mkcifscred -h server1 -u user1

Location

/usr/sbin/mkcifscred

Files

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