Chinaunix首页 | 论坛 | 博客
  • 博客访问: 512023
  • 博文数量: 235
  • 博客积分: 1209
  • 博客等级: 少尉
  • 技术积分: 1417
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-19 19:59
文章分类

全部博文(235)

文章存档

2012年(107)

2011年(128)

分类:

2011-11-23 00:34:19

一个邮件日志脚本,突然有一天发现,无法自动把日志传送到之日服务器,脚本都是一样的。
手动scp也过不去,ssh也无法验证
通过ssh -v进行错误查看
  1. [root@wjyz02 ~]# ssh -v maillog@192.168.1.100
  2. OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
  3. debug1: Reading configuration data /etc/ssh/ssh_config
  4. debug1: Applying options for *
  5. debug1: Connecting to 192.168.1.100 [192.168.1.100] port 22.
  6. debug1: Connection established.
  7. debug1: permanently_set_uid: 0/0
  8. debug1: identity file /root/.ssh/identity type -1
  9. debug1: identity file /root/.ssh/id_rsa type 1    观察到这行的type和正常验证的不一样,正常的值是-1
  10. debug1: identity file /root/.ssh/id_dsa type -1
  11. debug1: loaded 3 keys
  12. debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
  13. debug1: match: OpenSSH_4.3 pat OpenSSH*
  14. debug1: Enabling compatibility mode for protocol 2.0
  15. debug1: Local version string SSH-2.0-OpenSSH_4.3
  16. debug1: SSH2_MSG_KEXINIT sent
  17. debug1: SSH2_MSG_KEXINIT received
  18. debug1: kex: server->client aes128-ctr hmac-md5 none
  19. debug1: kex: client->server aes128-ctr hmac-md5 none
  20. debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
  21. debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
  22. debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
  23. debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
  24. debug1: Host '192.168.1.100' is known and matches the RSA host key.
  25. debug1: Found key in /root/.ssh/known_hosts:1
  26. debug1: ssh_rsa_verify: signature correct
  27. debug1: SSH2_MSG_NEWKEYS sent
  28. debug1: expecting SSH2_MSG_NEWKEYS
  29. debug1: SSH2_MSG_NEWKEYS received
  30. debug1: SSH2_MSG_SERVICE_REQUEST sent
  31. debug1: SSH2_MSG_SERVICE_ACCEPT received
  32. debug1: Authentications that can continue: publickey,password
  33. debug1: Next authentication method: publickey
  34. debug1: Trying private key: /root/.ssh/identity
  35. debug1: Offering public key: /root/.ssh/id_rsa
  36. debug1: Authentications that can continue: publickey,password
  37. debug1: Trying private key: /root/.ssh/id_dsa
  38. debug1: Next authentication method: password
  39. maillog@192.168.1.100:
下面的信息也没有太明显的错误之类的,于是删掉本地的私钥,删掉文件夹,通过ssh-keygen生成.ssh文件夹,把私钥拷过来,还是不可以。
愣住了,这可咋办,查看ssh --help  发现个-i的参数,于是ssh -i /pwd/id_rsa_test name@192.168.1.100 奇迹发生,验证通过了,-i /root/.ssh/id_rsa 还是不可以,看来不是我id_rsa 的问题,是
.ssh这个文件的问题,手动建立了.ssh文件夹,拷贝id_rsa在ssh name@192.168.1.100通过了

  1. debug1: identity file /root/.ssh/id_rsa type -1
这个验证也变成了-1




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