#!/bin/bash
# ssh no password login 

read -p "请输入目标主机IP：" ipaddr
read -s -p "请输入主机密码：" passwd
read -p "\n请输入用户名：" user

echo "以下一路回车"
ssh-keygen
ssh-copy-id  -i ~/.ssh/id_rsa.pub $user@$ipaddr

