1. 程式人生 > >mac使用ssh-keygen和ssh-copy-id三步實現SSH無密碼登入

mac使用ssh-keygen和ssh-copy-id三步實現SSH無密碼登入

ssh-keygen :產生公鑰與私鑰對. ssh-copy-id :將本機的公鑰複製到遠端機器的authorized_keys檔案中,ssh-copy-id也能讓你有到遠端機器的home, ~./ssh , 和 ~/.ssh/authorized_keys的權利 以下是實現步驟: 第一步:在本地機器上使用ssh-keygen產生公鑰私鑰對
  1. [email protected]:~/$ ssh-keygen
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/zhz/.ssh/id_rsa):
  2. Enter passphrase (empty for no passphrase): [Press enter key
  3. same passphrase again: [Pess enter key]
  4. Your identification has been saved in /home/zhz/.ssh/id_rsa.
  5. Your public key has been saved in /home/zhz/.ssh/id_rsa.pub.
  6. The key fingerprint is:
  7. 用cat命令檢視是否生成產生公鑰私鑰對
  8. [email protected]:~$ cat .ssh/id_rsa.pub
  9. 如果生成成功,則進行下一步
  10. 第二步:用ssh-copy-id將公鑰複製到遠端機器中
  11. 但是預設MAC沒有ssh-copy-id命令,但是我們可以手動給心愛的mac安裝這個常用到的命令
  12. 這個是github上找到的解決辦法https://github.com/beautifulcode/ssh-copy-id-for-OSX
  13. 執行下面的這個命令,請求並執行ssh-copy-id安裝命令
  14. sudo curl -L https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/install.sh | sh
  15. 本人執行的時候會因為/usr/local下沒有bin資料夾而失敗,只需要在/usr/local資料夾下sudo mkdir bin新建一個bin目錄
  16. 然後出現Installed ssh-copy-id into /usr/local/bin說明安裝成功,接下來便可用用ssh-copy-id將公鑰複製到遠端機器中
  17. ssh-copy-id -i .ssh/id_rsa.pub  使用者名稱字@xxx.xxx.xxx.xxx
  18. 這時候會讓你輸入登入密碼,輸入登入密碼之後便OK了
  19. 之後再執行ssh 使用者名稱@xxx.xxx.xxx.xxx便不需要密碼

相關推薦

【轉】使用ssh-keygenssh-copy-id實現SSH無密碼登錄

works message targe auth mes unix use ner not 【原】http://blog.chinaunix.net/uid-26284395-id-2949145.html ssh-keygen 產生公鑰與私鑰對. ssh-copy-id

使用ssh-keygenssh-copy-id實現SSH無密碼登入

from  http://blog.chinaunix.net/uid-26284395-id-2949145.html ssh-keygen  產生公鑰與私鑰對. ssh-copy-id 將本機的公鑰複製到遠端機器的authorized_keys檔案中,ssh-copy

mac使用ssh-keygenssh-copy-id實現SSH無密碼登入

ssh-keygen :產生公鑰與私鑰對. ssh-copy-id :將本機的公鑰複製到遠端機器的authorized_keys檔案中,ssh-copy-id也能讓你有到遠端機器的home, ~.

運維~ssh-copy-id實現SSH無密碼登入ssh常用命令

ssh-keygen  產生公鑰與私鑰對. ssh-copy-id 將本機的公鑰複製到遠端機器的authorized_keys檔案中,ssh-copy-id也能讓你有到遠端機器的home, ~./ssh , 和 ~/.ssh/authorized_keys的權利

ssh-copy-id實現SSH無密碼登入ssh常用命令

ssh-keygen  產生公鑰與私鑰對. ssh-copy-id 將本機的公鑰複製到遠端機器的authorized_keys檔案中,ssh-copy-id也能讓你有到遠端機器的home, ~./ssh , 和 ~/.ssh/authorized_keys的權利 第一步:

ssh-keygenssh-copy-id實現免密登入遠端主機

       ssh免密登入在實際工作中有重要的作用,甚至有的應用部署也必須要免密登入遠端主機,例如hadoop環境搭建。       免密登入,需要先在本機生成公鑰,然後將公鑰拷貝到遠端主機,拷貝的過程,既可以手動(在遠端主機根目錄下建立.ssh目錄,然後將公鑰存入該目錄下

linux設定ssh免密登入ssh-copy-id命令

linux系統配置免密碼的方式: 1:ssh-keygen -t rsa ssh-keygen -t dsa 生成金鑰 2:ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected] # 接下來一路回車到底

ssh-keygen + ssh-copy-id 無密碼登入遠端伺服器

1.在~/.ssh/ 下生成金鑰 xx@xx:~/.ssh$ ssh-keygen -t rsa -f ~/.ssh/id_rsa_xx -C "Key for ssh stuff" 使用剛生成的金鑰, 用ssh-copy-id 將伺服器地址加入

無密鑰登錄的自動腳本實現ssh-copy-id、expect免交互輸入腳本)

無密鑰登錄的自動腳本實現(ssh-copy-id、expect免交互輸入腳本)無密鑰登錄的自動腳本實現:vim auto_ssh.sh#!/usr/bin/expect set timeout 10 set username [lindex $argv 0] set password [linde

利用ssh-copy-id實現SSH無密碼登錄

ssh copy id 第一步: 產生公鑰與私鑰對:[[email protected]]# ssh-keygen -t rsa按照提示輸入完後,會在~/.ssh目錄下生成id_rsa和id_rsa.pub這兩個文件 第二步:用ssh-copy-id將公鑰復制到遠程機器中ssh-copy

ssh-copy-id命令解析

ssh-agent mac 優先 出了 agent 刪除 是否 bsp -c ssh-copy-id命令可以把本地主機的公鑰復制到遠程主機的authorized_keys文件上, ssh-copy-id命令也會給遠程主機的用戶主目錄(home)和~/.ssh, 和~/.s

expect 執行ssh-copy-id

-c dex nbsp display PE pri audio splay res vi deploy_ssh_key.exp #!/usr/bin/expect -f set timeout 2 set ipaddress [lindex $argv 0] set

解決ssh-copy-id時Host key verification failed的錯誤

wan 復制 ant mark con 用戶 本地 RoCE oot 如果因為某種原因(服務器系統重裝,服務器間IP地址交換,DHCP,虛擬機重建,中間人劫持),這裏筆者是因為虛擬機重建的緣故,該IP地址的公鑰改變了,當使用 SSH 連接的時候會出現 然後筆者把.s

免密登錄ssh-copy-id 如何使用非22端口 + rsync 同步遠程機器的文件到本地

bsp art --delete 保存 ssh 參考 主機 使用 刪除 其中:id_rsa為私鑰文件,id_rsa.pub為公鑰文件 ssh-copy-id -i ~/.ssh/id_rsa.pub "-p 2122 root@IP " 我的:ssh-copy-id

eclipse MAT (二)分析報告的生成記憶體消耗分析

在文章eclipse MAT (二)進行OutOfMemoryError的診斷分析 生成了一個檔案java_pid3708.hprof,這個檔案 在你的專案的根目錄下 一,生成分析報告 首先,啟動前面安裝配置好的 Memory Analyzer tool , 然後選擇選單項 File-

區域網無紙化會議封裝,只需實現推流播放

又名 基於rstp的錄屏直播 上篇文章 步驟: 1.下載lib到本地,然後依賴 RtspServerAndVlcPlay git clone https://github.com/wobiancao/RtspServerAndVlcPlay.git 如果

Linux設定免密登入的幾種方法(ssh-copy-id / ansible)

一. ssh-keygen -t rsa 生成公鑰、私鑰 authorized_keys:存放遠端免密登入的公鑰,主要通過這個檔案記錄多臺機器的公鑰 id_rsa : 生成的私鑰檔案 id_rsa.pub : 生成的公鑰檔案 know_hosts : 已知的主

scp ssh-copy-id 無法通過通過root 使用者傳送檔案或公鑰解決辦法

廢話不說直接解決問題 問題原因: 無法通過root使用者傳送檔案或公鑰至遠端伺服器 如下圖: 解決辦法: sudo vim /etc/ssh/sshd_config 找到  LoginGraceTime PermitRootLogin StrictModes 將以上三項改為:

實現通過域名訪問tomcat的httphttps伺服器

在上一篇介紹了通過tomcat的https釋出蘋果應用,這一篇在其基礎上改變其ip為域名訪問,其實很簡單,三步就搞定。 1.開啟tomcat目錄下的conf/server.xml檔案,修改Host標籤下的name屬性為你要配置的域名,如圖: 2.修改http埠為80

Linux命令:ssh-copy-id

already some sshd spl track ... hid mean eal ssh-copy-id幫助 1 SSH-COPY-ID(1)