一个邮件日志脚本,突然有一天发现,无法自动把日志传送到之日服务器,脚本都是一样的。
手动scp也过不去,ssh也无法验证
通过ssh -v进行错误查看
- [root@wjyz02 ~]# ssh -v maillog@192.168.1.100
-
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
-
debug1: Reading configuration data /etc/ssh/ssh_config
-
debug1: Applying options for *
-
debug1: Connecting to 192.168.1.100 [192.168.1.100] port 22.
-
debug1: Connection established.
-
debug1: permanently_set_uid: 0/0
-
debug1: identity file /root/.ssh/identity type -1
-
debug1: identity file /root/.ssh/id_rsa type 1 观察到这行的type和正常验证的不一样,正常的值是-1
-
debug1: identity file /root/.ssh/id_dsa type -1
-
debug1: loaded 3 keys
-
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
-
debug1: match: OpenSSH_4.3 pat OpenSSH*
-
debug1: Enabling compatibility mode for protocol 2.0
-
debug1: Local version string SSH-2.0-OpenSSH_4.3
-
debug1: SSH2_MSG_KEXINIT sent
-
debug1: SSH2_MSG_KEXINIT received
-
debug1: kex: server->client aes128-ctr hmac-md5 none
-
debug1: kex: client->server aes128-ctr hmac-md5 none
-
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
-
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
-
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
-
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
-
debug1: Host '192.168.1.100' is known and matches the RSA host key.
-
debug1: Found key in /root/.ssh/known_hosts:1
-
debug1: ssh_rsa_verify: signature correct
-
debug1: SSH2_MSG_NEWKEYS sent
-
debug1: expecting SSH2_MSG_NEWKEYS
-
debug1: SSH2_MSG_NEWKEYS received
-
debug1: SSH2_MSG_SERVICE_REQUEST sent
-
debug1: SSH2_MSG_SERVICE_ACCEPT received
-
debug1: Authentications that can continue: publickey,password
-
debug1: Next authentication method: publickey
-
debug1: Trying private key: /root/.ssh/identity
-
debug1: Offering public key: /root/.ssh/id_rsa
-
debug1: Authentications that can continue: publickey,password
-
debug1: Trying private key: /root/.ssh/id_dsa
-
debug1: Next authentication method: password
-
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通过了
- debug1: identity file /root/.ssh/id_rsa type -1
这个验证也变成了-1
阅读(12578) | 评论(4) | 转发(1) |