小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

ssh, scp 免輸入密碼訪問

 憂郁_小剛 2012-10-28



經(jīng)常在不同linux機器之間互相scp拷文件,每次總是要輸入密碼才可行。

通過ssh-keygen生成公鑰,在兩臺機器之間互相建立信任通道即可。

假設本地機器client,遠程機器為server。

1. 生成rsa keygen

[winter@client winter] $ ssh-keygen -b 1024 -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/winter/.ssh/id_rsa): <Enter>
Enter passphrase (empty for no passphrase): <Enter>
Enter same passphrase again: <Enter>
Your identification has been saved in /home/winter/.ssh/id_rsa.
Your public key has been saved in /home/winter/.ssh/id_rsa.pub.
The key fingerprint is:
33:d4:7b:9c:87:04:cf:14:40:22:6d:c7:15:78:97:6a winter@client

直接上面公鑰和私鑰存放地址可以直接回車,私鑰密碼可以直接回車,也可以輸入。

2. 查看.ssh目錄下了多私鑰和公鑰文件

[winter@client winter] $ ls .ssh/
id_rsa  id_rsa.pub  known_hosts

3. 拷貝公鑰到目標機器上,并改名成authorized_keys

[winter@client winter] $ scp .ssh/id_rsa.pub winter@192.168.0.110:/home/winter/.ssh/authorized_keys
The authenticity of host '192.168.0.110(192.168.0.110)' can't be established.
RSA key fingerprint is 5b:78:e8:e9:dc:d8:db:bd:f7:66:44:e6:3b:ce:f2:79.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.110' (RSA) to the list of known hosts.
winter@192.168.0.110's password: <Enter>
id_rsa.pub                                                                     100%  221     1.2MB/s   00:00

首次scp命令時候還是會提示輸入密碼,還有是否繼續(xù)鏈接的提示,以后

4. 測試ssh進入

[winter@client winter] $ ssh 192.168.0.110

5. ok,搞定!

[winter@server winter] # it's ok!




[winter@client winter] $ ssh 192.168.0.110

5. ok,搞定!

[winter@server winter] # it's ok!

    本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內(nèi)容,請點擊一鍵舉報。
    轉藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多