This topic provides examples of SSH key generation for password-less login to the Delphix command-line interface (CLI).
Prerequisites
These operations are performed as a command-line user on a non-Dephix host, where SSH is installed.
-
usernamerefers to the existing command-line user on the non-Delphix host. -
host namerefers to the existing non-Delphix host.
The examples below should work with a variety of SSH distributions. However, your distribution may behave differently. If you are unable to follow these instructions successfully, consult with your system administrator and/or your operating system or SSH client vendor. Please note that only RSA protocol 2 keys are supported.
Procedure
The following example details three ways to set up password-less authentication:
-
Use an existing SSH key with no passphrase
-
Generate a new SSH key stored in the default location
-
Generate a new SSH key stored in a non-default location
Use an existing SSH key with no passphrase
To use an existing SSH key for password-less authentication, that key must have been established with no passphrase. If the existing SSH key has a passphrase associated with it, instead follow the instructions for generating a new SSH key stored in a non-default location below.
-
Log in as
usernametohostname. -
In the
~username/.ssh/directory, there are one or more.pubfiles. For example:-
id_dsa.pub -
id_rsa.pub -
identity.pub
The different names correspond to the different types of keys SSH can use. Only RSA protocol 2 keys are supported.
-
-
Input the contents of
id_rsa.pubinto thepublicKeyfield as described in CLI cookbook: configuring key-based SSH authentication for automation.
Generate a new SSH key stored in the default location
-
Log in as
usernametohostname. -
Ensure there are no
.pubfiles in the~username/.ssh/directory. If there are, you must either use the existing SSH key as described above or generate a new SSH key in a non-default location as described below. -
Create your RSA protocol 2 keys with no passphrase.
-
Run
ssh-keygen -t rsa
This command creates two new files in~username/.ssh/:id_rsaandid_rsa.pub
-
-
You are prompted to type and confirm your passphrase. Press Enter twice to create a key with no passphrase for password-less authentication.
-
Input the contents of your new
id_rsa.pubfile in the~username/.ssh/directory in thepublicKeyfield as described in CLI cookbook: configuring key-based SSH authentication for automation.
Generate a new SSH key stored in a non-default location
-
Log in as
usernametohostname. -
Choose the filename for your new SSH key files, for example:
delphix_keyanddelphix_key.pub -
Create your keys with no passphrase.
-
Run
ssh-keygen -t rsa -f delphix_key
This command creates two new files:delphix_keyanddelphix_key.pub -
You are prompted to type and confirm your passphrase. Press Enter twice to create a key with no passphrase for password-less authentication.
-
Input the contents of your new
.pubfile in the~username/.ssh/directory in thepublicKeyfield as described in CLI cookbook: configuring key-based SSH authentication for automation. -
On subsequent login attempts to the Delphix CLI, specify the private SSH key to use with the -i argument, for example:
ssh -i ~/delphix_key username@delphixserver.company.com