1 Star 1 Fork 0

dongdonglog/ansible自动化部署k3s

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ssh.sh 443 Bytes
一键复制 编辑 原始数据 按行查看 历史
dongdonglog 提交于 2023-09-11 18:01 . add:添加离线部署v1
#/bin/bash
#1.创建密钥
echo "正在创建..."
if [ -f /root/.ssh/id_rsa ]
then
echo "密钥对已经存在"
else
ssh-keygen -f /root/.ssh/id_rsa -N '' > /tmp/create_ssh.log 2>&1
fi
#分发密钥
echo "正在分发..."
#for ip in $(cat ip_list.txt)
for ip in 192.168.1.179 192.168.1.4
do
sshpass -p "123456" ssh-copy-id ${ip} -o StrictHostKeyChecking=no > /tmp/create_ssh.log 2>&1
echo "验证结果: $(ssh ${ip} hostname)"
done
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/dongdonglog/ansible-k3s.git
git@gitee.com:dongdonglog/ansible-k3s.git
dongdonglog
ansible-k3s
ansible自动化部署k3s
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385