Ssh without password: Difference between revisions
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
* Type the following to generate the ssh key: | * Type the following to generate the ssh key: | ||
<source lang='bash'> | <source lang='bash'> | ||
ssh-keygen | ssh-keygen | ||
</source> | </source> | ||
* Accept the default key location by pressing <code>Enter</code>. | * Accept the default key location by pressing <code>Enter</code>. | ||
Line 19: | Line 19: | ||
<source lang='bash'> | <source lang='bash'> | ||
cd ~/.ssh | cd ~/.ssh | ||
ssh-copy-id remote_username@remote_host | |||
</source> | </source> | ||
== Configuring ssh without password for Anunna == | == Configuring ssh without password for Anunna == | ||
Line 53: | Line 30: | ||
Use pAGEaNT: http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter9.html to generate local keys. You'll want have a copy of the pubkey in plaintext available. | Use pAGEaNT: http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter9.html to generate local keys. You'll want have a copy of the pubkey in plaintext available. | ||
Make sure to paste that plaintext string into ~/.ssh/authorized_keys in one single line. Chmod the file 600 (so it shows -rw------- in ls -l) | Make sure to paste that plaintext string into ~/.ssh/authorized_keys in one single line. Chmod the file 600 (so it shows -rw------- in ls -l) and the directory .ssh to 700 (drwx------). | ||
Now PuTTY will login passwordlessly whenever pAGEaNT is running. | Now PuTTY will login passwordlessly whenever pAGEaNT is running. |
Revision as of 17:28, 26 July 2019
Secure shell (ssh) protocols can be configure to work without protocols. This is particularly helpful for machines that are used often.
Configuring ssh without password from a POSIX-compliant terminal
Step 1: create a public key and copy to remote computer
- Log into a local Linux or MacOSX computer
- Type the following to generate the ssh key:
<source lang='bash'> ssh-keygen </source>
- Accept the default key location by pressing
Enter
. - Secure permission of your authentication keys by closing permission to your home directory, .ssh directory, and authentication files
<source lang='bash'> chmod go-w $HOME chmod 700 $HOME/.ssh chmod go-rwx $HOME/.ssh/* </source>
- Type the following to copy the key to the remote server (this will prompt for a password).
<source lang='bash'> cd ~/.ssh ssh-copy-id remote_username@remote_host </source>
Configuring ssh without password for Anunna
- Create a public key as in Step 1 of the previous section and copy it to Anunna. Note that a public/private key pair needs to be made only once per machine.
- Similar to step 2 of the previous section, add the public key to the
$HOME/.ssh/authorized_keys2
file. There is already a$HOME/.ssh/authorized_keys
present. You may append the key to this file as an alternative, but take care not to remove content that is already there. The cluster is configured so that passwordless communication will all other nodes is default.
Configuring ssh without password using PuTTY
Use pAGEaNT: http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter9.html to generate local keys. You'll want have a copy of the pubkey in plaintext available.
Make sure to paste that plaintext string into ~/.ssh/authorized_keys in one single line. Chmod the file 600 (so it shows -rw------- in ls -l) and the directory .ssh to 700 (drwx------).
Now PuTTY will login passwordlessly whenever pAGEaNT is running.
Finally, get pAGEaNT to load on startup: http://blog.shvetsov.com/2010/03/making-pageant-automatically-load-keys.html