使用DNS登录机器

#!/bin/sh

domain='www.baidu.net'

user=`whoami`

if [ ${user} == user1 ];then

   passkey='user1.pem'

else

   user=user2

   passkey='user2.pem'

fi

if [ $# == 1 ];then

    ssh -o StrictHostKeyChecking=no -i ${passkey}  ${user}@$1.${domain}

else

    echo "Usage 1.200/2.200/1.201/1.202/2.202"

fi

你可能感兴趣的:(使用DNS登录机器)