Chinaunix首页 | 论坛 | 博客
  • 博客访问: 77977
  • 博文数量: 51
  • 博客积分: 328
  • 博客等级: 一等列兵
  • 技术积分: 360
  • 用 户 组: 普通用户
  • 注册时间: 2011-05-09 17:06
文章分类

全部博文(51)

文章存档

2013年(6)

2012年(45)

我的朋友

分类:

2013-01-05 21:46:02

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登陆网站时会自动判断使用哪一对密钥认证


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