use ssh scp without password - AthenaTzeng/myTool GitHub Wiki

[email protected] want to use ssh/scp to [email protected]

IDEA: make a pub/priv key for from and write the pub_key to to

from$ ssh-keygen -t rsa
Enter file in which to save the key (/home/from/.ssh/id_rsa):[Enter]
Enter passphrase (empty for no passphrase):[Enter]
Enter same passphrase again:[Enter]

from$ scp /.ssh/id_rsa.pub [email protected]:/
[Enter password]

to$ cat id_rsa.pub >> .ssh/authorized_keys2
==>NOTE: this is because of that the authorized_keys2 might exist
if so, just add the chars in id_rsa.pub at the end of the file

  1. NOTE for dsa
    from$ ssh-keygen -t dsa
    to$ cat id_dsa.pub >> .ssh/authorized_keys

  2. NOTE!!!
    from and to must be the correct users
    only this two users can have the no-password ssh link (scp)

⚠️ **GitHub.com Fallback** ⚠️