Команда scp привела к «Отказано в доступе (publickey, клавиатура-интерактив)» - PullRequest
0 голосов
/ 30 октября 2019

Я пытаюсь передать файл с локального хоста на удаленный хост, используя scp, и получаю сообщение об ошибке, описанное ниже, и до сих пор не нашел решения.

I 'я пытаюсь перенести файлы в кластер под управлением Debian64-5779 linux (csh).

Итак, запустив эту команду для переноса файла с локального хоста на удаленный хост sg.cs.huji.ac.il:

~% scp file ekushele%hm-03@sg.cs.huji.ac.il:file1

И это дает:

(OTP) Password: 120761      #one time password I need to insert
Pseudo-terminal will not be allocated because stdin is not a terminal.
Permission denied (publickey,keyboard-interactive).

Я понимаю, что проблема в удаленном хосте, который является кластером (то есть я не могу редактировать файлы, такие как /etc/ssh/sshd_config).

Я пытался запустить

~% scp -tt file ekushele%hm-03@sg.cs.huji.ac.il:file1

Дает:

scp: ambiguous target

Вот вывод с параметром -v:

~% scp -v file ekushele%hm-03@sg.cs.huji.ac.il:file1
OpenSSH_7.7p1 Debian-3, OpenSSL 1.0.2o  27 Mar 2018
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to sg.cs.huji.ac.il [132.65.116.14] port 22.
debug1: Connection established.
debug1: identity file /cs/icore/ekushele/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /cs/icore/ekushele/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cs/icore/ekushele/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cs/icore/ekushele/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cs/icore/ekushele/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cs/icore/ekushele/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cs/icore/ekushele/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cs/icore/ekushele/.ssh/id_ed25519-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cs/icore/ekushele/.ssh/id_xmss type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cs/icore/ekushele/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.7p1 Debian-3
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.8
debug1: match: OpenSSH_5.8 pat OpenSSH_5* compat 0x0c000000
debug1: Authenticating to sg.cs.huji.ac.il:22 as 'ekushele%hm-03'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:3XhDXFJP1+5vOjgjNbrij+ToelQxsuZujjJoaD9H8NE
debug1: Host 'sg.cs.huji.ac.il' is known and matches the ECDSA host key.
debug1: Found key in /cs/icore/ekushele/.ssh/known_hosts:2
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:1s7v7GCzEOWDUx4GIp52pjxALHIKfp/hohlEe7EDXBU /cs/icore/ekushele/.ssh/id_rsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Trying private key: /cs/icore/ekushele/.ssh/id_dsa
debug1: Trying private key: /cs/icore/ekushele/.ssh/id_ecdsa
debug1: Trying private key: /cs/icore/ekushele/.ssh/id_ed25519
debug1: Trying private key: /cs/icore/ekushele/.ssh/id_xmss
debug1: Next authentication method: keyboard-interactive
(OTP) Password: 033354
debug1: Authentication succeeded (keyboard-interactive).
Authenticated to sg.cs.huji.ac.il ([132.65.116.14]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending command: scp -v -t file1
Pseudo-terminal will not be allocated because stdin is not a terminal.
Permission denied (publickey,keyboard-interactive).
lost connection
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Transferred: sent 2400, received 1776 bytes, in 7.0 seconds
Bytes per second: sent 340.9, received 252.2
debug1: Exit status 255

Я не думаю, что эту проблему можно решить, добавив файлы author_keys в каталог .ssh, потому что мой друг пытался перенести файл на тот же удаленный хост (sg.cs.huji.ac.il) и успешно без проблем.

Что я делаю не так?

...