Skip to content

Konmoron/ssh-copy-id

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssh-copy-id

中文

automate copy ssh public key to multiple remote servers

using this script help you to copy your ssh key to multiple remote servers with just one command.

first install sshpass using below command:

apt install sshpass -y

then generate your ssh-key with ssh-key command.

after that you should create host.txt:

# host_ip ssh_password ssh_port(default 22) ssh_user(default root)
127.0.0.1 password 22222 username
chmod +x sshcopyid.sh
./sshcopyid.sh

for example:

# sshcopyid.sh default use host.txt
./sshcopyid.sh
./sshcopyid.sh -f host_a.txt
./sshcopyid.sh -i 127.0.0.1 -P sshpassword -p sshport -u sshuser

help:

$ ./sshcopyid.sh -h
automate copy ssh public key to multiple remote servers

Usage: ./sshcopyid.sh [OPTIONS]

Options:
  -f, --host-file       host file txt. default: host.txt
  -i, --host-ip         host ip
  -u, --ssh-user        ssh user
  -p, --ssh-port        ssh port
  -P, --ssh-password    ssh password
  -h, --help            display this help and exit

thanks:

About

automate copy ssh public key to multiple remote servers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages