ssh密钥

main
PC-202302260912\Administrator 2023-12-06 16:11:48 +08:00
parent 4673125b56
commit 9a0f48c1c0
1 changed files with 2 additions and 2 deletions

View File

@ -1,14 +1,14 @@
#!/bin/bash
# 新增服务器列表
servers=("62.234.41.104")
servers=("101.42.178.28" "43.138.74.65" "101.43.235.69" "43.138.57.52" "43.143.136.9")
# 本地计算机的SSH公钥路径
local_public_key="$HOME/.ssh/id_rsa.pub"
# 远程主机的用户名和密码
remote_user="root"
remote_password="52z=];k3ScDy^Zp7"
remote_password="zEwwBkTivMKGuNpJ77mh"
for server in "${servers[@]}"; do
# 使用sshpass命令将密码传递给ssh-copy-id并将公钥追加到服务器