SFTP 未切換到密碼模式

SFTP 未切換到密碼模式

兩台伺服器,同步配置和ssh金鑰。當連接到目的地時,第一台伺服器切換到密碼模式:

debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug3: start over, passed a different list password,publickey,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /root/.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-dss blen 433
debug2: input_userauth_pk_ok: fp xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
debug3: sign_and_send_pubkey
debug1: read PEM private key done: type DSA
Authenticated with partial success.
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
Password Authentication
debug2: input_userauth_info_req: num_prompts 1
Password:

當第二個伺服器進入無限循環時:

debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering DSA public key: /root/.ssh/id_dsa
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-dss blen 433
debug2: input_userauth_pk_ok: fp xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx [MD5]
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type DSA
Authenticated with partial success.
debug2: key: /root/.ssh/id_dsa ((nil)), explicit
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Trying private key: /root/.ssh/id_dsa
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type DSA
debug2: we sent a publickey packet, wait for reply
Authenticated with partial success.
debug2: key: /root/.ssh/id_dsa ((nil)), explicit
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Trying private key: /root/.ssh/id_dsa
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type DSA
debug2: we sent a publickey packet, wait for reply
Authenticated with partial success.
debug2: key: /root/.ssh/id_dsa ((nil)), explicit
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Trying private key: /root/.ssh/id_dsa
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type DSA
debug2: we sent a publickey packet, wait for reply
Authenticated with partial success.
debug2: key: /root/.ssh/id_dsa ((nil)), explicit
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Trying private key: /root/.ssh/id_dsa
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type DSA
debug2: we sent a publickey packet, wait for reply
....

有什麼想法嗎?

答案1

問題似乎出在 ssh 用戶端二進位檔案:

OpenSSH_6.6.1p1, OpenSSL 0.9.8j-fips 07 Jan 2009

複製舊的 ssh 二進位檔案後,我可以連接到目標伺服器。

答案2

我的情況略有不同。我有一個腳本,它透過 sftp 使用密碼身份驗證從遠端伺服器下載檔案(在 Expect 的幫助下)。當我升級作業系統(Solaris10 x86)時,sftp 突然停止詢問密碼:

$ sftp -b batches/batch_file [email protected]
Permission denied (password).
Connection closed

當我新增-o BatchMode=no到命令列時,出現密碼提示:

$ sftp -o BatchMode=no -b batches/batch_file  [email protected]
[email protected]'s password:

相關內容