Гость
Как я могу подключиться к моему экземпляру EC2 по ssh из неинтерактивной среды (codebuild/buildspec)
Сообщение
Гость » 11 мар 2024, 13:07
Я пытаюсь подключиться к своему серверу по ssh, чтобы запустить сценарий bash, и пока получаю эту ошибку. Насколько я понимаю, ошибка в основном возникает из-за
read_passphrase: can't open /dev/tty: Нет такого устройства или адреса
:
Код: Выделить всё
agent_1 | [Container] 2024/03/11 09:11:24 Phase context status code: Message:
agent_1 | [Container] 2024/03/11 09:11:24 Entering phase BUILD
agent_1 | [Container] 2024/03/11 09:11:24 Running command ssh -v -o PreferredAuthentications=publickey -i ~/.ssh/id_rsa ec2-user@$EC2_HOST "ls /var/www/xx-api"
agent_1 | OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
agent_1 | debug1: Reading configuration data /root/.ssh/config
agent_1 | debug1: /root/.ssh/config line 1: Applying options for *
agent_1 | debug1: /root/.ssh/config line 4: Applying options for 13.235.xx.yy
agent_1 | debug1: Reading configuration data /etc/ssh/ssh_config
agent_1 | debug1: /etc/ssh/ssh_config line 58: Applying options for *
agent_1 | debug1: Connecting to 13.235.xx.yy [13.235.xx.yy] port 22.
agent_1 | debug1: fd 3 clearing O_NONBLOCK
agent_1 | debug1: Connection established.
agent_1 | debug1: permanently_set_uid: 0/0
agent_1 | debug1: identity file /root/.ssh/id_rsa type 4
agent_1 | debug1: key_load_public: No such file or directory
agent_1 | debug1: identity file /root/.ssh/id_rsa-cert type -1
agent_1 | debug1: Enabling compatibility mode for protocol 2.0
agent_1 | debug1: Local version string SSH-2.0-OpenSSH_7.4
agent_1 | debug1: Remote protocol version 2.0, remote software version OpenSSH_8.7
agent_1 | debug1: match: OpenSSH_8.7 pat OpenSSH* compat 0x04000000
agent_1 | debug1: Authenticating to 13.235.xx.yy:22 as 'ec2-user'
agent_1 | debug1: SSH2_MSG_KEXINIT sent
agent_1 | debug1: SSH2_MSG_KEXINIT received
agent_1 | debug1: will use strict KEX ordering
agent_1 | debug1: kex: algorithm: curve25519-sha256
agent_1 | debug1: kex: host key algorithm: ecdsa-sha2-nistp256
agent_1 | debug1: kex: curve25519-sha256 need=64 dh_need=64
agent_1 | debug1: kex: curve25519-sha256 need=64 dh_need=64
agent_1 | debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
agent_1 | debug1: Server host key: ecdsa-sha2-nistp256 SHA256:xx
agent_1 | Warning: Permanently added '13.235.xx.yy' (ECDSA) to the list of known hosts.
agent_1 | debug1: resetting send seqnr 3
agent_1 | debug1: rekey after 134217728 blocks
agent_1 | debug1: SSH2_MSG_NEWKEYS sent
agent_1 | debug1: expecting SSH2_MSG_NEWKEYS
agent_1 | debug1: resetting read seqnr 3
agent_1 | debug1: SSH2_MSG_NEWKEYS received
agent_1 | debug1: rekey after 134217728 blocks
agent_1 | debug1: SSH2_MSG_EXT_INFO received
agent_1 | debug1: kex_input_ext_info: server-sig-algs=
Источник: [url]https://stackoverflow.com/questions/78139808/how-can-i-ssh-inside-my-ec2-instance-from-a-non-interactive-environment-codebui[/url]
1710151632
Гость
Я пытаюсь подключиться к своему серверу по ssh, чтобы запустить сценарий bash, и пока получаю эту ошибку. Насколько я понимаю, ошибка в основном возникает из-за [b]read_passphrase: can't open /dev/tty: Нет такого устройства или адреса[/b] : [code]agent_1 | [Container] 2024/03/11 09:11:24 Phase context status code: Message: agent_1 | [Container] 2024/03/11 09:11:24 Entering phase BUILD agent_1 | [Container] 2024/03/11 09:11:24 Running command ssh -v -o PreferredAuthentications=publickey -i ~/.ssh/id_rsa ec2-user@$EC2_HOST "ls /var/www/xx-api" agent_1 | OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 agent_1 | debug1: Reading configuration data /root/.ssh/config agent_1 | debug1: /root/.ssh/config line 1: Applying options for * agent_1 | debug1: /root/.ssh/config line 4: Applying options for 13.235.xx.yy agent_1 | debug1: Reading configuration data /etc/ssh/ssh_config agent_1 | debug1: /etc/ssh/ssh_config line 58: Applying options for * agent_1 | debug1: Connecting to 13.235.xx.yy [13.235.xx.yy] port 22. agent_1 | debug1: fd 3 clearing O_NONBLOCK agent_1 | debug1: Connection established. agent_1 | debug1: permanently_set_uid: 0/0 agent_1 | debug1: identity file /root/.ssh/id_rsa type 4 agent_1 | debug1: key_load_public: No such file or directory agent_1 | debug1: identity file /root/.ssh/id_rsa-cert type -1 agent_1 | debug1: Enabling compatibility mode for protocol 2.0 agent_1 | debug1: Local version string SSH-2.0-OpenSSH_7.4 agent_1 | debug1: Remote protocol version 2.0, remote software version OpenSSH_8.7 agent_1 | debug1: match: OpenSSH_8.7 pat OpenSSH* compat 0x04000000 agent_1 | debug1: Authenticating to 13.235.xx.yy:22 as 'ec2-user' agent_1 | debug1: SSH2_MSG_KEXINIT sent agent_1 | debug1: SSH2_MSG_KEXINIT received agent_1 | debug1: will use strict KEX ordering agent_1 | debug1: kex: algorithm: curve25519-sha256 agent_1 | debug1: kex: host key algorithm: ecdsa-sha2-nistp256 agent_1 | debug1: kex: curve25519-sha256 need=64 dh_need=64 agent_1 | debug1: kex: curve25519-sha256 need=64 dh_need=64 agent_1 | debug1: expecting SSH2_MSG_KEX_ECDH_REPLY agent_1 | debug1: Server host key: ecdsa-sha2-nistp256 SHA256:xx agent_1 | Warning: Permanently added '13.235.xx.yy' (ECDSA) to the list of known hosts. agent_1 | debug1: resetting send seqnr 3 agent_1 | debug1: rekey after 134217728 blocks agent_1 | debug1: SSH2_MSG_NEWKEYS sent agent_1 | debug1: expecting SSH2_MSG_NEWKEYS agent_1 | debug1: resetting read seqnr 3 agent_1 | debug1: SSH2_MSG_NEWKEYS received agent_1 | debug1: rekey after 134217728 blocks agent_1 | debug1: SSH2_MSG_EXT_INFO received agent_1 | debug1: kex_input_ext_info: server-sig-algs= Источник: [url]https://stackoverflow.com/questions/78139808/how-can-i-ssh-inside-my-ec2-instance-from-a-non-interactive-environment-codebui[/url]
0 Ответы
31 Просмотры
Последнее сообщение Anonymous
16 окт 2024, 23:39
0 Ответы
8 Просмотры
Последнее сообщение Anonymous
06 май 2025, 18:34
0 Ответы
12 Просмотры
Последнее сообщение Anonymous
15 фев 2025, 05:57
0 Ответы
13 Просмотры
Последнее сообщение Anonymous
17 фев 2025, 02:15
0 Ответы
17 Просмотры
Последнее сообщение Anonymous
06 мар 2024, 07:16