#!/bin/bash
if [ -z $1 ];then
echo “WARRNING:”
echo “first value is remote server ipaddress!”
exit 1
fi
cd ~/.ssh
if [ -z $2 ];then
ssh-copy-id -f root@$1
else
ssh-copy-id -f -p $2 root@$1
fi
添加公钥的一个半自动脚本
发表评论
#!/bin/bash
if [ -z $1 ];then
echo “WARRNING:”
echo “first value is remote server ipaddress!”
exit 1
fi
cd ~/.ssh
if [ -z $2 ];then
ssh-copy-id -f root@$1
else
ssh-copy-id -f -p $2 root@$1
fi