Chinaunix首页 | 论坛 | 博客
  • 博客访问: 173311
  • 博文数量: 18
  • 博客积分: 804
  • 博客等级: 军士长
  • 技术积分: 220
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-01 13:30
文章分类

全部博文(18)

文章存档

2015年(1)

2012年(2)

2011年(1)

2010年(2)

2009年(12)

分类: LINUX

2010-09-08 11:28:30

SSH authorzied 认证和如何加快连接速度

1.ssh 无密码登陆(注:源端192.168.99.254; 目标端192.168.99.253)
  • 在源端生成ras人pub key。

 [blackspace@DNS ~]$ ssh-keygen -t rsa
 Generating public/private rsa key pair.
 Enter file in which to save the key     (/home/blackspace/.ssh/id_rsa):               --> Enter
 Created directory '/home/blackspace/.ssh'.
 Enter passphrase (empty for no passphrase):  -->Enter
 Enter same passphrase again:                 -->Enter
 Your identification has been saved in /home/blackspace/.ssh/id_rsa.
 Your public key has been saved in /home/blackspace/.ssh/id_rsa.pub.
 The key fingerprint is:
 3e:ed:38:4d:3a:81:6b:19:14:be:df:c3:48:98:31:aa
 [blackspace@DNS ~]$

  • 复制源端(jieless.com)/root/.ssh/id_rsa.pub到目标端/root/.ssh/下并命名为:authorized_keys

#scp /root/.ssh/id_rsa.pub     
注:authorized_keys是在目标端的/etc/ssh/sshd_config中定义的,当然这个文件名也可以自己定义。

目标端是没有/root/.ssh/的,需要手动建。mkdir /root/.ssh/

  • 到此key的制定就完成了。以后在源端通过ssh连接目标端192.168.99.253就不再使用密码了。

2.ssh加速度:

  ssh速度慢的原因主要是因为DNS查询的问题。加速度的前提也就是把DNS的反向解析的命令去掉。

  • 在目标端:#vi /etc/ssh/sshd_config
    #UseDNS yes -->把#去掉,把yes改为no
    UseDNS no
    (如果没有这个键值,手动添加即可)

    GSSAPIAuthentication yes
    修改为
    GSSAPIAuthentication no
    (如果没有这个键值,手动添加即可)
  • 保存退出:qw
  • 重启ssh  #service sshd restart
  • 重新连接,一般就可以解决连接速度慢的问题。


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

chinaunix网友2010-09-09 20:29:39

Download More than 1000 free IT eBooks: http://free-ebooks.appspot.com