Importing an SSH Public Key for a User (addpublickey)
Function
The addpublickey command is used to import an SSH public key for a user.
Format
ipmcset -t user -d addpublickey -v username filepath file URL
Parameters
Parameter |
Description |
Value |
---|---|---|
username |
Specifies the user for whom the SSH public key is to be imported. |
An existing user name. |
filepath |
Specifies the path from which the public key will be imported. |
The value must be in the /Path/File name format. For example, /tmp/id_dsa_2048.key |
file URL |
Specifies the URL of the public key file to be imported. |
A value in the following format: protocol://username:password@IP:[port]/directory/filename Where:
|
Usage Guidelines
Before running this command, use a file transfer tool that supports SFTP, for example WinSCP, to transfer the SSH public key file to the specified directory (for example /tmp) of the iBMC file system.
The administrators can import SSH public keys for all users. Common users can import only their own SSH public keys.
Example
# Import an SSH public key for user ssh_user.
iBMC:/->ipmcset -t user -d addpublickey -v ssh_user /tmp/id_dsa_2048.key
Input your password:
Add user public key successfully.