connect-ec2-ssh

Generate a temporary SSH key and connect to an EC2 instance via EC2 Instance Connect.

19|14|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/X-School-Academy/skill-pilot --skill connect-ec2-ssh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: connect-ec2-ssh
Source: https://github.com/X-School-Academy/skill-pilot/tree/main/core/skills/system/connect-ec2-ssh
Command: npx skills add https://github.com/X-School-Academy/skill-pilot --skill connect-ec2-ssh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies and secures the process of connecting to EC2 instances by generating temporary SSH keys, pushing them via EC2 Instance Connect, and establishing a persistent tmux session, eliminating the need for pre-existing or long-lived SSH keys.

Core Features & Use Cases

  • Temporary SSH Key Generation: Creates short-lived ed25519 keys for enhanced security.
  • EC2 Instance Connect Integration: Leverages AWS's secure, temporary key injection mechanism.
  • Automated SSH Configuration: Updates local SSH profiles for easy reconnection.
  • Persistent Tmux Sessions: Ensures your session remains active even if disconnected.
  • Use Case: Quickly and securely access a new EC2 instance for a time-bound task without the overhead of managing permanent SSH keys.

Quick Start

Connect to the EC2 instance with ID 'i-0123456789abcdef0' using the IP address '54.12.34.56' and the default 'ubuntu' user.

Frequently Asked Questions about connect-ec2-ssh

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect to an EC2 instance without a pre-existing SSH key pair?

You can connect to an EC2 instance without a pre-existing SSH key pair by generating a temporary SSH key and pushing it via EC2 Instance Connect. This ensures secure, ephemeral access without managing permanent credentials.

What is the best way to maintain a persistent SSH session on an EC2 instance?

The best way to maintain a persistent SSH session is by initiating a tmux session after connecting. This ensures your terminal session remains active and processes continue running even if your network connection drops.

How does EC2 Instance Connect work for secure access?

EC2 Instance Connect works by generating a short-lived ed25519 SSH key and pushing it to the target instance. It updates your local SSH configuration to facilitate secure, temporary access without long-lived keys.

Do I need long-lived SSH keys to access an EC2 instance securely?

No, you do not need long-lived SSH keys to access an EC2 instance securely. You can use EC2 Instance Connect to push temporary, short-lived SSH keys, ensuring compliance with security best practices.

Can I automatically update my local SSH configuration for EC2 Instance Connect?

Yes, your local SSH configuration can be automatically updated when connecting. The process pushes a temporary key to the EC2 instance and modifies your local SSH profiles to enable easy reconnection.