import-ssh-key
Import a new SSH key from a file into the S-Filer Portal certificate manager.
Syntax:
sfiler-cli [options] import-ssh-key [command options]
Command Options | Required/Optional | Description |
---|---|---|
-a | Required | The key alias (the key alias must be unique). |
-rsa | Optional | The file containing the RSA SSH key. |
-rsa-pw | Optional | The password to access the RSA key if it is password-protected. |
-rsa-opw | Optional | The obfuscated password allowing access to the RSA key if it is password-protected. |
-dsa | Optional | The file containing the DSA SSH key. |
-dsa-pw | Optional | The password to access the DSA key if it is password-protected. |
-dsa-opw | Optional | The obfuscated password allowing access to the DSA key if it is password-protected. |
-damm | Optional | Specifies the behavior to adopt if the specified alias already exists in the database. Possible values are: fail, replace, or generate-new. Default: fail. |
Example:
./sfiler-config-cli.sh -l my-user -p my-password -cf "conf/sfiler.conf" import-ssh-key -a "My SSH Key" -f ssh-dsa-key.key -kt dsa
Running this command will import the certificate from the ssh-dsa-key.key file with the alias "My SSH Key" into the S-Filer Portal certificate manager.
If the same command is executed again, it will return an error because the alias "My SSH Key" already exists in the database. To avoid this error, the -damm option can be used to specify the behavior to adopt if the alias already exists in the database.
The possible values are:
- fail: the command returns an error (default value).
- replace: the existing key with this alias will be deleted and the new key will be inserted with the same alias.
- generate-new: a new alias will be generated based on the specified one and the new key will be imported with the generated alias.
When the key file is password-protected, either the -pw or -opw option must be used to specify the password. If both options are used, -pw will take precedence.
It is possible to combine the -rsa and -dsa options to import an RSA and a DSA key into the S-Filer Portal certificate manager.
./sfiler-config-cli.sh -l my-user -p my-password -cf "conf/sfiler.conf" import-ssh-key -a "My SSH Key" -rsa ssh-rsa-key.key -dsa ssh-dsa-key.key
Running this command will import the certificates from the ssh-rsa-key.key and ssh-dsa-key.key files with the alias "My SSH Key" into the S-Filer Portal certificate manager.