打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
SSH 免密碼登入 快速三步驟

SSH 免密碼登入 快速三步驟

被登入的主機當 Server,自己的當 Client

Step1 : 在 Client 端建立 Public 與 Private Key


$ssh-keygen -t dsa <==這個步驟產生 Keys
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa): <== 按下 Enter
Enter passphrase (empty for no passphrase): <== 按 Enter
Enter same passphrase again: <== 再按一次 Enter
Your identification has been saved in /root/.ssh/id_dsa. <== 私鑰
Your public key has been saved in /root/.ssh/id_dsa.pub. <== 公鑰
The key fingerprint is:
c4:ae:d9:02:d1:ba:06:5d:07:e6:92:e6:6a:c8:14:ba test@test.com


Step2 : 在 Server 端放置 Client 可以登入的公鑰


$cd ~/.ssh
$scp id_dsa.pub root@192.168.1.1:~/


Step3 : 登入到 Server 端,將公鑰轉存到 authorized_keys 檔案中


$ssh 192.168.1.1
$cat id_dsa.pub >> .ssh/authorized_keys


Ya!!! 大功告成! That‘s it!!!
 
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
用ssh-keygen来设置ssh无密码登录
ssh使用公匙和密匙无密码传输文件
Oracle RAC安装配置流程
SSH免密码登录详解
配置linux服务器之间ssh不用密码访问
Client 免输密码ssh登录Server
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服