+5 votes
363 views
How to copy files by ssh, scp without password

in Linux / Unix by (552k points) | 363 views

1 Answer

+3 votes
Best answer

It is often the case that you need to automate a copy of a file to another server with scp, such as making a backup on one server and send it to another server that uses it as a file server, as a problem that when invoking the server scp command, this one, ask for password or password.

This we can avoid

On the source computer we launch:

ssh-keygen -t rsa

This command generates two files, id_rsa.pub and id_rsd. We need to copy the contents of the first to the other computer and add it to the authorized_keys file inside ~ / .ssh /

By scp we send this file id_rsa.pub to the destination server

On the destination server we add the file to authorized_keys

cat id_rsa.pub >> .ssh / authorized_keys

And we can make a scp without a password


by (552k points)

Related questions

+4 votes
1 answer
asked May 26, 2019 in Linux / Unix by backtothefuture (552k points) | 198 views
+4 votes
1 answer
asked May 11, 2019 in Linux / Unix by backtothefuture (552k points) | 206 views
+4 votes
1 answer
asked Feb 18, 2020 in Linux / Unix by backtothefuture (552k points) | 309 views
+4 votes
1 answer
asked Jul 10, 2020 in Linux / Unix by backtothefuture (552k points) | 323 views
+3 votes
1 answer
asked Nov 17, 2019 in Linux / Unix by backtothefuture (552k points) | 300 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users