手机版
你好,游客 登录 注册
背景:
阅读新闻

SSH(Secure SHell)使用

[日期:2012-09-29] 来源:Linux社区  作者:btchenguang [字体:大 中 小]

4.3 进行ssh的密钥连接-在Ubuntu下制作密钥

4.3.1 在Linux下生成密钥
在命令行下运行:
> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/compilers/.ssh/id_rsa):  #输入私钥保存地址
Enter passphrase (empty for no passphrase):  #输入私钥密码
Enter same passphrase again:  #确认密码
Your identification has been saved in /home/compilers/.ssh/id_rsa.
Your public key has been saved in /home/compilers/.ssh/id_rsa.pub.
The key fingerprint is:
e7:f6:98:57:f0:d9:93:54:30:76:9f:10:09:c0:f8:b9 compilers@compilers-vm
The key's randomart image is:
+--[ RSA 2048]----+
|        o....o*..|
|       . .   o.o+|
|        . .    .o|
|         o  .  . |
|        S o  o.o.|
|         E    +o.|
|          o  .  .|
|         . +.    |
|          o..    |
+-----------------+
4.3.2 把公钥写入authorized_keys文件中
> cd ~/.ssh
> cat id_rsa.pub >> quthorized_keys #需要换行加入新的内容
4.3.3 生成putty私钥
1. 把id_rsa传到windows系统上。
2. 使用puttygen的"Load private key"读取id_rsa文件,并输入私钥密码:
 
文本框里的内容应该和id_rsa.pub中的一致。点击"Save private key"保存私钥。
4.3.4 使用putty进行密钥登录
那就是和之前一样的操作:
 
linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款