+4 votes
203 views

Enter by ssh without password on another computer


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

1 Answer

+5 votes
Best answer

Copy files to another computer by ssh without password

Many times we need to perform automatic tasks and copy files between computers via ssh, the problem we always have is that when trying to connect it asks for the password of the destination computer and of course, this breaks all the automatic sequence, to perform this task should be a person entering the password every time. So we are interested in working with ssh without a password.

Until now, I had been using a sequence in which the public key and the private key were generated from the source computer, the generated key was copied to the destination computer, the key was added to a configuration file of the destination computer and thus detected the equipment as a team with a trust relationship and let us access and copy files  through the ssh protocol without the need to enter a password .

Today I have another way of doing it much simpler, with the ssh-copy-id instruction.

The sequence to be made would be:

In the source computer, we generate the key rsa ssh-keygen -t rsa.

Once the password is generated (without password) with the command ssh-copy-id -i (location of the public key, usually in the .ssh / id_rsa.pub folder) target_computer_username@ip_equipment_office, with this command it will ask for the password of the destination team and copy the key in the file of trusted keys of the target computer, this way we saved a job of several instructions, I found it a pass and I avoided a lot of mess.

If we want to access the destination machine, it will be enough with ssh user_equipo_destino @ ip_equipo_destino and we will access without a password.


by (552k points)

Related questions

+5 votes
1 answer
asked May 26, 2019 in Linux / Unix by backtothefuture (552k points) | 362 views
+3 votes
1 answer
+3 votes
1 answer
asked Jun 22, 2019 in Windows 10 by backtothefuture (552k points) | 414 views
+5 votes
1 answer
asked Sep 23, 2020 in Linux / Unix by backtothefuture (552k points) | 338 views
+3 votes
1 answer
asked Nov 17, 2019 in Linux / Unix by backtothefuture (552k points) | 305 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