<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ## 配置ssh免秘鑰登錄 ssh 無密碼登錄要使用公鑰與私鑰。linux下可以用用ssh-keygen生成公鑰/私鑰對,下面我以CentOS為例。 有機器A(130.75.131.245),B(130.75.131.246)。現想A通過ssh免密碼登錄到B。 * 在130.75.131.245機下生成公鑰/私鑰對。 [root@localhost .ssh]# ssh-keygen -t rsa -P表示密碼,-P '' 就表示空密碼,也可以不用-P參數,這樣就要三車回車,用-P就一次回車。 它在/home/chenlb下生成.ssh目錄,.ssh下有id_rsa和id_rsa.pub。 * 把130.75.131.245下的id_rsa.pub復制到B機下,在B機的.ssh/authorized_keys文件里, 從A機復制的id_rsa.pub添加到.ssh/authorzied_keys文件里。 A機器 mv id_rsa.pub authorized_keys ftp authorized_keys上傳到B機器 由于還沒有免密碼登錄的,所以要輸入密碼。 [root@localhost .ssh]$catid_rsa.pub>>.ssh/authorized_keys [root@localhost .ssh]$chmod 600 .ssh/authorized_keys **authorized_keys的權限要是600**。 * 130.75.131.245機登錄130.75.131.246機。 ssh -p 130.75.131.246 Theauthenticityofhost'130.75.131.246(130.75.131.246)'can'tbeestablished. RSAkeyfingerprintisab:35:91:08:b7:48:52:35:aa:d2:53:f9:51:fe:c2:55. Areyousureyouwanttocontinueconnecting(yes/no)yes Warning:Permanentlyadded'130.75.131.246'(RSA)tothelistofknownhosts. 第一次登錄是時要你輸入yes。 現在A機可以無密碼登錄B機了。 小結:登錄的機子可有私鑰,被登錄的機子要有登錄機子的公鑰。這個公鑰/私鑰對一般在私鑰宿主機產生。上面是用rsa算法的公鑰/私鑰對,當然也可以用dsa(對應的文件是id_dsa,id_dsa.pub) 想讓A,B機無密碼互登錄,那B機以上面同樣的方式配置即可。 參考:SSH-KeyGen 的用法[http://blog.163.com/chen98_2006@126/blog/static/158584272007101862513886/](http://blog.163.com/chen98_2006@126/blog/static/158584272007101862513886/) ## 130.75.131.245制作同步腳本 /root/webapps/ 下存應用 ![](https://box.kancloud.cn/119572bc5282d84312decd35a88e34f6_683x133.png) * [root@localhost ~]# vi /root/synwas.ini 130.75.131.246 :wq ``` [root@localhost ~]# cat synwas.ini 130.75.131.246 ``` * [root@localhost ~]# vi synwas.sh ``` #!/bin/bash for DESIP in `cat /root/synwas.ini | grep -v "#"` do #--node1 rsync -avze ssh --delete --exclude="eureka-server/logs/**/*" --exclude="auth-server/logs/**/*" --exclude="user-center/logs/**/*" --exclude="api-gateway/logs/**/*" --exclude="file-center/logs/**/*" --exclude="back-center/logs/**/*" /root/webapps/ ${DESIP}:/root/webapps/ done ``` * [root@localhost ~]# chmod -R 777 synwas.sh * [root@localhost ~]# ./synwas.sh sending incremental file list sent 38,007 bytes received 142 bytes 1,774.37 bytes/sec total size is 371,068,157 speedup is 9,726.81 根據以上部署,升級只需要往130.75.131.245升級 驗證通過后,執行./synwas.sh同步到130.75.131.246,當然你也可以配置多臺服務器到synwas.ini,注意免密登錄
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看