wiki:cypress/ssh_public-key_authentication

Set up SSH public-key authentication

Using SSH public-key authentication to connect to a remote system is a robust, more secure alternative to logging in with an account password.

See if you have public-key generated.

local:~ user$ ls ~/.ssh
config id_rsa id_rsa.pub known_hosts

*.pub is your public-key. If you don't have it,

local:~ user$ ssh-keygen -t rsa

You will be prompted to supply a filename (for saving the key pair) and a passphrase (for protecting your private key):

Filename: To accept the default filename (and location) for your key pair, press Enter or Return without entering a filename. Password: If you press Enter or Return without entering a passphrase, your private key will be generated without password-protection.

SCP to copy the public key file (e.g., ~/.ssh/id_rsa.pub) to your account on the remote system (e.g., usersID@…);

 local:~ user$ scp ~/.ssh/id_rsa.pub usersID@cypress.tulane.edu:

Don't forget ':'  You'll be prompted for your account password. Your public key will be copied to your home directory (and saved with the same filename) on the remote system.

Log into Cypress using your account username and password.

local:~ user$ ssh userID@cypress.tulane.edu

You must have "id_rsa.pub" on your home directory

[user@cypress ~ $] ls id_rsa.pub
id_rsa.pub

On the remote system, add the contents of your public key file (e.g., ~/id_rsa.pub) to a new line in your ~/.ssh/authorized_keys file; on the command line, enter:

 [user@cypress ~ $] cat ~/id_rsa.pub >> ~/.ssh/authorized_keys

You may now safely delete the public key file (e.g., ~/id_rsa.pub) on Cypress; on the command line, enter:

  rm ~/id_rsa.pub

Now you should be able to login Cypress without typing password from next time.

Last modified 3 months ago Last modified on 11/08/22 19:14:08
Note: See TracWiki for help on using the wiki.