How to setup SSH to not ask password always: SSH

Incoming from STEPHANE DURIEUX:

Well everything is in the title. would like to use ssh in scripts so without entering the password.

local:

ssh-keygen -t rsa -b4096 -f ~/.ssh/id_rsa_to_xx
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519_to_xx

When it asks for your passphrase, hit ENTER.
Now (assuming ”xx:~/.ssh/” exists):

xx:

mkdir ~/.ssh

local:

scp ~/.ssh/id_rsa_to_xx.pub xx:~/.ssh

Add identity to be used for xx host

local:

vim ~/.ssh/config

~/.ssh/config:

Host xx
  IdentityFile ~/.ssh/id_rsa_to_xx
  User yy

xx:

cat ~/.ssh/id_rsa_to_xx.pub >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Now, anyone who gets into either box can compromise all of your
accounts on local and remote with ease. Have fun.

*UPDATE*

https://medium.com/risan/upgrade-your-ssh-key-to-ed25519-c6e8d60d3c54

Might be better to soon upgrade into ed25519 now, since likely it should be widely enough supported by now, and fallback to rsa in case it’s not supported.

/ Reference

Vastaa

Sähköpostiosoitettasi ei julkaista. Pakolliset kentät on merkitty *

This site uses Akismet to reduce spam. Learn how your comment data is processed.