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

in Linux / Unix by (551k points) | 342 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 (551k points)

Related questions

+4 votes
1 answer
asked May 26, 2019 in Linux / Unix by backtothefuture (551k points) | 181 views
+4 votes
1 answer
asked May 11, 2019 in Linux / Unix by backtothefuture (551k points) | 191 views
+4 votes
1 answer
asked Feb 18, 2020 in Linux / Unix by backtothefuture (551k points) | 295 views
+4 votes
1 answer
asked Jul 10, 2020 in Linux / Unix by backtothefuture (551k points) | 307 views
+3 votes
1 answer
asked Nov 17, 2019 in Linux / Unix by backtothefuture (551k points) | 289 views
Sponsored articles cost $40 per post. You can contact us via Feedback
10,634 questions
10,766 answers
510 comments
3 users