吴峰的博客

1.服务器进行互信

执行  ssh-keygen -t rsa一路回车

进入/root/ 执行ssh-copy-id -i .ssh/id_rsa.pub  root@127.0.0.1根据项目配置对应IP!!!

2.添加脚本文件 /usr/bin/board

#!/bin/bash

function trapper() {
    trap "" INT EXIT TSTP TERM HUP
}

function main() {
while true
do
    trapper
    clear
    cat <<menu
	输入编号选择服务器:
	1)服务器1
	2)服务器2
    3)exit
menu

read -p "Please input a num:" num
case $num in
    1)
        echo "login in 服务器1..."
        ssh root@127.0.0.1
        ;;
    2)
        echo "login in 服务器2..."
        ssh root@127.0.0.1
        ;;
    3)
        exit
        ;;
esac
done
}

main




Tags:
评论 (1)
  • DaltonOntot

    DaltonOntot

    Hello. And Bye. https://zootovaryvsem.org/

  • 说点什么吧... (取消回复)

    正在加载验证码......

    请先拖动验证码到相应位置

Copyright 吴峰的博客 © 2014-2016 管理员邮箱:phpwufeng@163.com   统计:   ICP备案:鲁ICP备16004939号-1