TechBooky AI Assistant
TechBooky AI Assistant
👋 Welcome to TechBooky AI Assistant

I can help with:
🔎 Tech News
🤖 AI Topics
💻 Gadgets
☁️ Cloud
✍️ Guest Posts
📢 Advertising
🔗 Backlinks
📩 Newsletter
  • AI Search
  • Cryptocurrency
  • Earnings
  • Enterprise
  • About TechBooky
  • Submit Article
  • Advertise With TechBooky
  • Contact Us
  • Data Intelligence
TechBooky
  • African
  • AI
  • Metaverse
  • Gadgets
  • Data Intelligence
  • AI Search
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
  • African
  • AI
  • Metaverse
  • Gadgets
  • Data Intelligence
  • AI Search
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
TechBooky
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Home Research/How to do it

Recovering SSH Access on AWS – A Step-by-Step Guide

Here is an account of how I faced this problem and how I solved it

Paul Femi Balo by Paul Femi Balo
December 23, 2024
in Research/How to do it
Share on FacebookShare on Twitter
Share this story

Send it to someone who should read it.

f Facebook X X in LinkedIn wa WhatsApp tg Telegram @ Email

In Brief
  • Managing cloud infrastructure can sometimes be tricky, especially when you lose SSH access to your instances.
  • I recently encountered a challenging situation while trying to update SSH settings on a server hosted on AWS but this can be applied to any other...
  • Here, I’ll share the step-by-step process I followed to recover access.

Managing cloud infrastructure can sometimes be tricky, especially when you lose SSH access to your instances. I recently encountered a challenging situation while trying to update SSH settings on a server hosted on AWS but this can be applied to any other major public cloud providers like Azure and GCP. I lost access and found myself unable to connect via SSH. Here, I’ll share the step-by-step process I followed to recover access. This guide can be useful for anyone facing similar issues or other problems that require detaching, repairing, and reattaching AWS volumes.

 

Step 1: Create a Snapshot of the Problematic Volume

  1. Navigate to the AWS Management Console: Go to the EC2 Dashboard.
  2. Locate Your Volume: Identify the volume attached to the instance that you are unable to access via SSH.
  3. Create a Snapshot: Select the volume, click on “Actions” and choose “Create Snapshot”. Give the snapshot a name and description for easy identification.

Step 2: Create and Attach a Recovery Volume

  1. Create a Volume from Snapshot: Go to the “Snapshots” section, select your snapshot, and click on “Actions” -> “Create Volume”. Choose the appropriate volume type and size.
  2. Attach the Volume to a Recovery Instance: Select the newly created volume, click on “Actions” -> “Attach Volume”. Attach it to a new or existing recovery instance in the same VPC. Use a device name like /dev/nvme1n1.

Step 3: Mount the Volume on the Recovery Instance

  1. Connect to the Recovery Instance: Use SSH to connect to the recovery instance.
    ssh ubuntu@recovery-instance-ip
    
  2. Verify the Attached Volume: Use lsblk to list all block devices and confirm the device name.
    sudo lsblk
    
  3. Create a Mount Point: Create a directory to mount the volume.
    sudo mkdir /mnt/recovery
    
  4. Mount the Volume: Mount the volume to the created directory.
    sudo mount /dev/nvme1n1p1 /mnt/recovery
    

Step 4: Reset SSH Configuration

  1. Backup Current SSH Configuration: Backup the SSH configuration file to ensure you can restore it if needed.
    sudo cp /mnt/recovery/etc/ssh/sshd_config /mnt/recovery/etc/ssh/sshd_config.backup
    
  2. Edit SSH Configuration: Open the SSH configuration file to allow root access and enable password authentication.
    sudo nano /mnt/recovery/etc/ssh/sshd_config
    

    Make the following changes:

    PermitRootLogin yes
    PasswordAuthentication yes
    
  3. Reset Root Password: Enter the chroot environment and reset the root password.
    sudo chroot /mnt/recovery
    passwd root
    

    Set and confirm the new password for the root user. Exit the chroot environment:

    Also worth reading
    AWS Opens First Chile Cloud Region With More Than $4B Planned Amazon AWS Growth Hits 39% as Earnings Miss Expectations AWS Puts $2.3B Behind Africa’s Cloud And AI Future AWS Buying DuckLabs Brings DuckDB Closer To The Cloud Data Wars Amazon AWS Growth Surges As AI Demand Gives Spending A Better Answer Recursive Superintelligence Signs $410M AWS Compute Deal
    exit
    

Step 5: Reattach the Volume to the Original Instance

  1. Unmount the Volume: Unmount the volume from the recovery instance.
    sudo umount /mnt/recovery
    
  2. Detach the Volume: Detach the volume from the recovery instance via the AWS Management Console.
  3. Attach the Volume to the Original Instance: Attach the volume to the original instance as /dev/nvme1n1.

Step 6: Verify and Access

  1. Reconnect via SSH: Attempt to SSH into the original instance using the root user.
    ssh root@original-instance-ip
    

Additional Use Cases Beyond SSH

This process can be adapted to troubleshoot and resolve other issues beyond SSH access. Here are some scenarios:

  1. Corrupted Filesystem: Use the recovery instance to check and repair the filesystem.
    sudo fsck /dev/nvme1n1p1
    
  2. Configuration Errors: Identify and correct misconfigurations by editing the necessary configuration files while the volume is mounted on the recovery instance.
  3. Data Backup and Recovery: Secure important data by copying files from the attached volume to another storage location.

 

By following these comprehensive steps, you can effectively regain access to your AWS instances and address various issues that may arise. This guide ensures that you have a reliable process for maintaining the availability and integrity of your server infrastructure.

If you encounter any specific challenges or need further assistance, feel free to reach out. 

Related Reading

More contextual TechBooky stories selected from tags, categories and article context.

  • Mandel-Threads-shouts
    Threads Tests Feature to Import Social Graphs and…
  • MS-Active-Directory
    Microsoft Traces Active Directory Issues to…
  • Azure-logo.png
    Azure Outage Blocks Access to Microsoft 365 and…
  • Microsoft_Office_Outlook_(2018–present).svg
    Microsoft Confirms Emergency Update for Millions of…
  • WordPress theme switch
    A Comprehensive Guide to Resolving File Permissions…
  • fzvH_kTA
    Orange Tunisie and Focus Team Up on Locally Hosted…
  • whatsapp icon
    WhatsApp Fixes Bug in View-Once Media Feature
  • 1_zJIuoKQtvIUyJmaQrVK9KQ
    Understanding the Atom of Thoughts Prompting Technique
Keep Reading Smarter

Search TechBooky with AI

Use TechBooky's AI Search to explore the context behind this story and related coverage across the site.

Try AI Search
More On This Topic
Research/How to do it
Follow TechBooky

Follow TechBooky for more technology stories and newsroom updates.

f Facebook X X in LinkedIn ig Instagram wa WhatsApp

Tags: awsserversshtips
Paul Femi Balo

Paul Femi Balo

Paul Femi Balo is the founder and publisher of TechBooky. He covers artificial intelligence, African technology, digital infrastructure, enterprise technology and the global digital economy.

Search TechBooky
Open TechBooky AI Search Try the AI Assistant

BROWSE BY CATEGORIES

Receive top tech news directly in your inbox

subscription from
Loading

Freshly Squeezed

  • AI Safety Groups Sue to Halt New Models From Five Tech Giants November 13, 2026
  • Google Brings Gemini 4 Hydrogen to Search Worldwide November 13, 2026
  • Notion Warns of API Keys in Chats Exposed by Fireworks Breach November 13, 2026
  • Nigeria Opens N4bn 3MTT Funding to Training Partners November 13, 2026
  • Microsoft Outage Hits Outlook and Other 365 Services November 12, 2026
  • UK AI Chip Startup Fractile Raises $720M at $7B Valuation November 12, 2026
  • TSMC Approves Up to $1B in OpenAI and Anthropic Stakes November 12, 2026
  • Jensen Huang Resigns as Nvidia CEO, Colette Kress Takes Over November 12, 2026
  • Chinese AI Firms Race to Rent Nvidia Compute Abroad, Reuters Says November 12, 2026
  • Google Picks 10 Startups for Its First Africa Applied AI Lab November 12, 2026
  • AWS Opens First Chile Cloud Region With More Than $4B Planned November 12, 2026
  • Critical Apache HTTP/2 Flaw Raises Remote Code Execution Risk November 12, 2026

Browse Archives

November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Quick Links

  • About TechBooky
  • Advertise With TechBooky
  • Contact us
  • Submit Article
  • Privacy Policy
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
  • AI
  • Data Intelligence
  • AI Search
  • African
  • Gadgets

© 2025 Designed By TechBooky Elite

Discover more from TechBooky

Subscribe now to keep reading and get access to the full archive.

Continue reading

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.