ssh(scp) without password

Useful function for exchanging data between servers without typing password.


(1) ssh-keygen -t rsa

“Generating public/private rsa key pair”

“Enter file in which to save the key …”

just push “enter” two times.


“Enter passphrase (empty for no passphrase):”

we are not going to use “passphrase”, so press “enter” key.



“Your identification had been saved in …”

“Your public key has been saved in …”


*you should remember the key file name and its direction.(end with *.pub)


(2) copy that key to remote linux computers.

adds to “/home/your_id/.ssh/authrized_keys”



(3) test

scp file.txt your_id@ip_address:/home/.

scp -P 7001 file.txt your_id@ip_address:/home/.     #with specific port, must be capital “P”.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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