SSH login without having to specify password each time

The following procedure works for OpenSSH_5.2p1, OpenSSL 0.9.8k-fips 25 Mar 2009. To check version of your ssh use $ssh -V. In case you have version other than this, please refer $man ssh and check which file permissions should be applied to Files (e.g. permissions of ~/.ssh/authorized_keys should be 640 otherwise ssh will ignore the file).

$:ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/swapnil/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/swapnil/.ssh/id_rsa.
Your public key has been saved in /home/swapnil/.ssh/id_rsa.pub.
The key fingerprint is:
67:50:53:ef:84:67:69:38:87:8a:03:14:fd:8b:df:68 swapnil@localhost.localdomain
The key's randomart image is:
+--[ RSA 2048]----+
| oo o.. |
| . .. . = . |
| . .. = O |
| . o.. O |
| S.+. . |
| .+. |
| . o |
| E . |
| . |
+-----------------+

Comment: Enter passphrase (empty for no passphrase): here simply enter a return key

Step 2:
$:cat .ssh/id_rsa.pub | ssh localhost 'cat >> .ssh/authorized_keys'
swapnil@localhost's password: 

Step 3:
$:chmod 600 ~/.ssh/authorized_keys  

Step 4: 
$:ssh localhostLast login: Fri May 21 16:06:34 2010 from localhost

 

Comments

Popular posts from this blog

Enhancing LLM Responses with Prompt Stuffing in Spring Boot AI

Automate Library Integration with Cursor's Agent Mode

Using AndroidViewModel for accessing application context