不用密码登录SSH(PUTTY)

2012-04-14 11:05 / no comment / 15 views /

一、生成密码对

ssh-keygen -t rsa -f ~/.ssh/id_rsa

会提示输入密码,可留空。

会生成
私有密钥: ~/.ssh/id_rsa.
公有密钥: ~/.ssh/id_rsa.pub.

二、授权

把生成的公有密钥放到被链主机的~/.ssh/authorized_keys文件中

cat .ssh/id_rsa.pub | ssh b@B ‘cat >> .ssh/authorized_keys’

三、登录

ssh b@B hostname

四、PUTTY登录

需要把私有密钥生成PUTTY的格式。打开PUTTY KEY GENERATURE,导入私有密钥,保存。会生成xxx.ppt文件。

在Connection->SSH->Auth中引入xxx.ppt文件。
在Connection->Data中输入用户名。

保存。

五、注意保护密钥

给~/.ssh目录和文件改权限。

A note from one of our readers: Depending on your version of SSH you might also have to do the following changes:

Put the public key in .ssh/authorized_keys2
Change the permissions of .ssh to 700
Change the permissions of .ssh/authorized_keys2 to 640

Related Posts

  1. Linux下查看版本号的命令
  2. 重启SCSI驱动
  3. vim命令速查表
  4. How to install samba on red Hat 4
  5. Error Codes 错误代码
  6. Hadoop编译安装
  7. Linux, Iometer / Dynamo usage
  8. mysql_db_query
  9. Altera QuartusII警告
  10. 汇编语言中段的定义

Get a Trackback link

No Comments Yet

You can be the first to comment!

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>