Score:0

Cant ssh to ec2 created from AMI of recently patched server

bb flag

One of my ec2 instance "patched-server-1" was running of kernel version 4.18.0-240.1.1.el8_3.x86_64 and then I did patched the server and current kernel version is 4.18.0-425.19.2.el8_7.x86_64 and I can ssh to the server , then I created an AMI from "patched -server-1" and launched new ec2 instance "patched-server-2" , I cant ssh to it. It give connection refused error.

Reason: Missing below file under /etc/ssh. These files are missing when I create ec2 instance with the image of upgraded kernel which fails the sshd service start, if I create instance from old kernel only then there is no issue.

MISSSING FILES
==============
-rw-r--r--  1 root root         82 May  2 17:30 ssh_host_ed25519_key.pub
-rw-r-----  1 root ssh_keys    387 May  2 17:30 ssh_host_ed25519_key
-rw-r--r--  1 root root        162 May  2 17:30 ssh_host_ecdsa_key.pub
-rw-r-----  1 root ssh_keys    492 May  2 17:30 ssh_host_ecdsa_key
-rw-r--r--  1 root root        554 May  2 17:30 ssh_host_rsa_key.pub
-rw-r-----  1 root ssh_keys   2578 May  2 17:30 ssh_host_rsa_key


ERROR
======

    OpenSSH_9.0p1, LibreSSL 3.3.6
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
    debug1: /etc/ssh/ssh_config line 54: Applying options for *
    debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/sharaddubey/.ssh/known_hosts'
    debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/sharaddubey/.ssh/known_hosts2'
    debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
    debug1: Connecting to ec2-3-6-40-188.ap-south-1.compute.amazonaws.com port 22.
    ssh: connect to host ec2-3-6-40-188.ap-south-1.compute.amazonaws.com port 22: Connection refused

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.