zoukankan      html  css  js  c++  java
  • Linux系统 SSH免密登入

    mia

    # ssh-keygen -t rsa

    # cp -r /root/.ssh/d_rsa.pub  /root/.ssh/authorized_keys

    # ssh-copy-id 192.168.2.176

     #!/bin/bash

    Server_IP=

    Server_Passwd=

    function SSH_CopyID(){

    expect -c "

            set timeout -1

            spawn ssh-keygen -t rsa

            expect {

                    "(/root/.ssh/id_rsa):" { send " " ;}

                    "(empty for no passphrase):" { send " ";}

                    "again:" { send " " ;}

            };

            expect eof;

        "

    expect -c "

            set timeout -1;

            spawn ssh-copy-id $Server_IP;

            expect {

                    "yes/no" { send "yes " ;}

                    "password:" { send "$Server_Passwd ";}

            };

            expect eof;

       "

    }

    SSH_CopyID

  • 相关阅读:
    基于Centos 7 vue+nginx+docker 的前端项目部署
    uni-app学习随笔
    微服务和Docker
    Ado.Net
    数据库(SQLServer)
    JavaScript
    CSS样式
    HTML前端标签
    vue中 拖动元素边框 改变元素宽度
    vue学习笔记14
  • 原文地址:https://www.cnblogs.com/devops-docker/p/11507172.html
Copyright © 2011-2022 走看看