Hoffman2:Password-less Logins: Difference between revisions

From Center for Cognitive Neuroscience
Jump to navigation Jump to search
(Created page with "The steps below will show you how to login without typing your password every time! On your local computer: a@A:-> '''ssh-keygen -t rsa''' Generating public/private rsa key...")
 
No edit summary
Line 2: Line 2:


On your local computer:
On your local computer:
  a@A:-> '''ssh-keygen -t rsa'''
  a@A:-> '''ssh-keygen'''
  Generating public/private rsa key pair.
  Generating public/private rsa key pair.
  Enter file in which to save the key (/Users/a/.ssh/id_rsa): '''[ENTER]'''
  Enter file in which to save the key (/Users/a/.ssh/id_rsa): '''[ENTER]'''

Revision as of 16:12, 10 April 2017

The steps below will show you how to login without typing your password every time!

On your local computer:

a@A:-> ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/a/.ssh/id_rsa): [ENTER]
Created directory '/Users/a/.ssh'.
Enter passphrase (empty for no passphrase): [ENTER]
Enter same passphrase again: [ENTER]
Your identification has been saved in /Users/a/.ssh/id_rsa.
Your public key has been saved in /Users/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A

Now use ssh to create a directory ~/.ssh as user on Hoffman2. (The directory may already exist, which is fine):

a@A:~> ssh user@hoffman2.idre.ucla.edu mkdir -p .ssh
user@hoffman2.idre.ucla.edu's password: [PASSWORD]

Finally append a's new public key to b@B:.ssh/authorized_keys and enter b's password one last time:

a@A:~> cat .ssh/id_rsa.pub | ssh user@hoffman2.idre.ucla.edu 'cat >> .ssh/authorized_keys'
user@hoffman2.idre.ucla.edu's password: [PASSWORD]

Now you can login to hoffman from local computer without a password!

a@A:~> ssh user@hoffman2.idre.ucla.edu