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. In the remainder of the document we will use the terms "username" and "host name" in the following way:
username
– the existing command line user on the non-Delphix hosthost
name
– 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 from Delphix version 5.0 onward, only RSA protocol 2 keys are supported.
Procedure
This example details three ways to set up password-less authentication:
- Using an existing SSH key with no passphrase
- Generating a new SSH key stored in the default location
- Generating a new SSH key stored in a non-default location
Using 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.
- Login as
username
tohostname
. - Within the
~username/.ssh/
directory, there will be one or more files whose names end in the.pub
extension, for example:id_dsa.pub
id_rsa.pub
identity.pub
- Input the contents of the id_rsa
.pub
file into the publicKey field as described in CLI Cookbook: Configuring Key-Based SSH Authentication for Automation.
Generating a New SSH Key Stored in the Default Location
- Login as
username
tohostname
. - Verify that there are no files with the
.pub
extension 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_rsa
andid_rsa.pub
- Run
- You will be prompted to enter a passphrase, and to confirm the passphrase. Simply hit Enter twice to create a key with no passphrase for password-less authentication.
- Input the contents of the created id_rsa
.pub
file in the~username/.ssh/
directory into the publicKey field as described in CLI Cookbook: Configuring Key-Based SSH Authentication for Automation.
Generating a New SSH Key Stored in a Non-Default Location
- Login as
username
tohostname
. - Choose the filename for your new SSH key files, for example:
delphix_key
anddelphix_key.pub
- Create your keys with no passphrase.
- Run
ssh-keygen -t rsa -f
delphix_key
This command creates two new filesdelphix_key
anddelphix_key.pub
- Run
- You will be prompted to enter a passphrase, and to confirm the passphrase. Simply hit Enter twice to create a key with no passphrase for password-less authentication.
- Input the contents of the created
.pub
file in the~username/.ssh/
directory into the publicKey field 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 be used with the -i argument, for example:
ssh -i ~/delphix_key username@delphixserver.company.com