The Linux Tool SSH-Copy-ID allows a password-less authentication for a SSH-connection.

It's part of the package openssh-client:

sudo apt install openssh-client

Firstly generate SSH-Keys on the machine that should later connect to another machine:

ssh-keygen

All prompts can be skipped!

Finally copy the created key to the target-machine (the machine, to which a password-less SSH-connection should later be established):

ssh-copy-id -i /path/to/public-keys <username>@<hostname-targetserver/ip>

Example:

ssh-copy-id -i /home/user/.ssh/id_rsa.pub root@10.0.1.230
  • linux/command-collection/ssh-copy-id.txt
  • Last modified: 2023/07/30 12:11
  • by Zyzonix