Chinaunix首页 | 论坛 | 博客
  • 博客访问: 658127
  • 博文数量: 102
  • 博客积分: 2241
  • 博客等级: 大尉
  • 技术积分: 1670
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-08 10:08
文章分类

全部博文(102)

文章存档

2013年(6)

2012年(15)

2011年(81)

分类: LINUX

2013-01-04 20:37:24

1.创建不同的SSH密钥, -t指定加密方法,RSA或DSA;-C注释;-f指定文件名

  1. ssh-keygen -t dsa -C "email.xxx" -f ~/.ssh/xxx
以上命令在~/.ssh/下生成xxx密钥对


2.编辑 ~/.ssh/config  文件,配置格式示例:
  1. Host github.com
  2.    IdentityFile ~/.ssh/code_github
  3. Host bitbucket.org
  4.    IdentityFile ~/.ssh/code_bitbucket
查看 man ssh_config 有更多参数说明

3.把xxx.pub公钥文件的内容加入到要自动登陆服务器指定用户下的~/.ssh/authorized_keys 文件中

4.使用ssh登陆网站时会自动判断使用哪一对密钥认证


阅读(6050) | 评论(0) | 转发(2) |
给主人留下些什么吧!~~