By using AWS re:Post, you agree to the Terms of Use
/Error SSH from LinuxBastion to EC2 instance running IBM-mq/

Error SSH from LinuxBastion to EC2 instance running IBM-mq

0

I just started trying AWS. I have 2 EC2 instances running. One is LinuxBastion and the other is ibm-mq. I can use Putty on my Windows laptop to SSH into LinuxBastion. According to document, I have to use agent forwarding to SSH from LinuxBastion to ibm-mq because it is in the private subnet. On my LinuxBastion session, I got error "Permission denied (publickey)". Console output is shown below.

[ec2-user@ip-10-0-149-123 ~]$ ssh -v -A 10.0.54.158

OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: /etc/ssh/ssh_config line 58: Applying options for *

debug1: Connecting to 10.0.54.158 [10.0.54.158] port 22.

debug1: Connection established.

debug1: identity file /home/ec2-user/.ssh/id_rsa type 1

debug1: key_load_public: No such file or directory

debug1: identity file /home/ec2-user/.ssh/id_rsa-cert type -1

debug1: key_load_public: No such file or directory

debug1: identity file /home/ec2-user/.ssh/id_dsa type -1

debug1: key_load_public: No such file or directory

debug1: identity file /home/ec2-user/.ssh/id_dsa-cert type -1

debug1: key_load_public: No such file or directory

debug1: identity file /home/ec2-user/.ssh/id_ecdsa type -1

debug1: key_load_public: No such file or directory

debug1: identity file /home/ec2-user/.ssh/id_ecdsa-cert type -1

debug1: key_load_public: No such file or directory

debug1: identity file /home/ec2-user/.ssh/id_ed25519 type -1

debug1: key_load_public: No such file or directory

debug1: identity file /home/ec2-user/.ssh/id_ed25519-cert type -1

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_7.4

debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.5

debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.5 pat OpenSSH* compat 0x04000000

debug1: Authenticating to 10.0.54.158:22 as 'ec2-user'

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug1: kex: algorithm: curve25519-sha256

debug1: kex: host key algorithm: ecdsa-sha2-nistp256

debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none

debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none

debug1: kex: curve25519-sha256 need=64 dh_need=64

debug1: kex: curve25519-sha256 need=64 dh_need=64

debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

debug1: Server host key: ecdsa-sha2-nistp256 SHA256:10R5udxzE60Uxw4p2pxVQOKm1NHt2IILwkATTqFwOdo

debug1: Host '10.0.54.158' is known and matches the ECDSA host key.

debug1: Found key in /home/ec2-user/.ssh/known_hosts:1

debug1: rekey after 134217728 blocks

debug1: SSH2_MSG_NEWKEYS sent

debug1: expecting SSH2_MSG_NEWKEYS

debug1: SSH2_MSG_NEWKEYS received

debug1: rekey after 134217728 blocks

debug1: SSH2_MSG_EXT_INFO received

debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>

debug1: SSH2_MSG_SERVICE_ACCEPT received

debug1: Authentications that can continue: publickey

debug1: Next authentication method: publickey

debug1: Offering RSA public key: /home/ec2-user/.ssh/id_rsa

debug1: Authentications that can continue: publickey

debug1: Trying private key: /home/ec2-user/.ssh/id_dsa

debug1: Trying private key: /home/ec2-user/.ssh/id_ecdsa

debug1: Trying private key: /home/ec2-user/.ssh/id_ed25519

debug1: No more authentication methods to try.

Permission denied (publickey).

asked 17 days ago20 views
2 Answers
0

have you set you key pair in you instance ?

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html

and allow connect from you windows to you ec2 instances at security gorup or acl or firewall ?

answered 17 days ago
0

Yes, I did. The key-pair name is KEY-PUTTY-US-E2 That is what I use to Putty/SSH into the LinuxBastion instance. When I display the instances, the column "Key Name" shows KEY-PUTTY-US-E2 for both the LinuxBastion and ibm-mq.

Here is the area that I am not clear. If I do SSH set up on on normal linux servers. I generate my key and copy the key to the target server. Here it seems that AWS did the key copy work already. Perhaps I misunderstood what the "key Name" column means.

answered 16 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions