歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux下不出現提示使用遠程拷貝命令SCP

Linux下不出現提示使用遠程拷貝命令SCP

日期:2017/2/25 10:39:11   编辑:Linux教程
  把你的本地主機用戶的ssh公匙文件寫入到遠程主機用戶的~/.ssh/authorized_keys文件中,具體方法 假設本地主機test1,遠程主機test2 一,在test1主機裡的用戶 運行 ssh-keygen -t rsa 結果如下 Generating public/private rsa key pair. Enter file in which to save the key (/home/.username/ssh/id_rsa):#回車 Enter passphrase (empty for no passphrase):#回車 Enter same passphrase again:#回車 Your identification has been saved in /home/.username /.ssh/id_rsa. Your public key has been saved in /home/.username /.ssh/id_rsa.pub. The key fingerprint is: 38:25:c1:4d:5d:d3:89:bb:46:67:bf:52:af:c3:17:0c username@localhost Generating RSA keys: Key generation complete. 會在用戶目錄~/.ssh/產生兩個文件,id_rsa,id_rsa.pub 二,把id_rsa.pub文件拷貝到test2主機的用戶目錄下 cat id_rsa.pub ~/.ssh/authorized_keys 就可以了 這樣test1主機的用戶就可以通過ssh而不用密碼登陸test2主機。
Copyright © Linux教程網 All Rights Reserved