我是meshbie,用於ssh和mysql命令。 我有一個使用無密碼驗證從一臺linux服務器備份到另一臺linux服務器的問題。我已經生成了無密碼身份驗證的密鑰並將其上傳到另一臺服務器。使用ssh從linux服務器備份命令問題
我已經使用這個命令
[[email protected] ~]$ mysqldump -u dbuser -p"dbpwd" --opt dbname | gzip -c | ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/...../known_hosts -l deploy -i /...../id_rsa -v [email protected] "/bin/cat > [email protected]:/......./test.sql.gz" 2>&1
現在,當我在SSH運行的命令,我得到了下面的錯誤
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
Credentials cache file '/tmp/krb5cc_20082' not found
debug1: Unspecified GSS failure. Minor code may provide more information
Credentials cache file '/tmp/krb5cc_20082' not found
debug1: Unspecified GSS failure. Minor code may provide more information
debug1: Unspecified GSS failure. Minor code may provide more information
debug1: Next authentication method: publickey
debug1: Offering public key: /home/indus33/.ssh/id_rsa
我用Google搜索了很多,但沒有辦法幫我。
如果有人對此有疑問,請問我。
請幫我解決這個問題。
更新
我運行命令
[用戶@ server1的〜] $ SSH -o StrictHostKeyChecking =沒有-o UserKnownHostsFile =/..../known_hosts中-l部署-i /。 .../id_rsa -v user2的@服務器2
錯誤
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /.../ssh_config
debug1: Applying options for *
debug1: Connecting to server2IP [server2IP] port 22.
debug1: Connection established.
debug1: identity file /......./id_rsa type 1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.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 'server2IP' is known and matches the RSA host key.
debug1: Found key in /......./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,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
Credentials cache file '/tmp/krb5cc_20082' not found
debug1: Unspecified GSS failure. Minor code may provide more information
Credentials cache file '/tmp/krb5cc_20082' not found
debug1: Unspecified GSS failure. Minor code may provide more information
debug1: Unspecified GSS failure. Minor code may provide more information
debug1: Next authentication method: publickey
debug1: Offering public key: /....../id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Last login: Mon Sep 30 03:25:52 2013 from server1
[email protected] [~]#
希望這個問題將清除所有.....
究竟發生了什麼(hangup/exit/signalX)?你能檢查服務器端GS? –
我沒有檢查任何服務器端日誌。 –
也許你可以粘貼確切的命令行和腳本的內容? (例如,您可以用ls替換真正的備份命令,例如更容易調試。) –