Differences
This shows you the differences between two versions of the page.
linux_wiki:ec2_ssh_access [2018/03/23 15:00] billdozor created |
linux_wiki:ec2_ssh_access [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== EC2: SSH Access ====== | ||
- | |||
- | **General Information** | ||
- | |||
- | About this page/ | ||
- | |||
- | **Checklist** | ||
- | * Requirement 1 | ||
- | * Requirement 2 | ||
- | |||
- | ---- | ||
- | |||
- | ====== EC2: Keys ====== | ||
- | |||
- | If you generate a key pair through the Amazon console, you will download a .pem file. | ||
- | * This file contains your key pair (private and public) and is used in ssh commands to login | ||
- | |||
- | \\ | ||
- | You can extract just your public key and output it in RSA format that Linux authorized_keys files expect.< | ||
- | * The output string can appended to a user's file at / | ||
- | |||
- | ---- | ||
- | |||
- | ====== EC2: SSH Access ====== | ||
- | |||
- | Accessing EC2 instances with a SSH key. | ||
- | |||
- | Pre-req Setup | ||
- | * Launch EC2 Instance | ||
- | * Create new key and download it or use existing SSH key pair | ||
- | * Transfer the .pem key to your system that you will jump from to AWS | ||
- | * Change permissions to read only for owner< | ||
- | |||
- | ---- | ||
- | |||
- | ===== EC2: Direct SSH To Public Facing System ===== | ||
- | |||
- | SSH to a system' | ||
- | |||
- | * Pre-req Setup complete | ||
- | * SSH using the pem key as the identity to a system' | ||
- | * AWS AMI<code bash>ssh -i keypair.pem ec2-user@public.ip.address.here</ | ||
- | * CentOS AMI<code bash>ssh -i keypair.pem centos@public.ip.address.here</ | ||
- | |||
- | ---- | ||
- | |||
- | ===== EC2: SSH Through Bastion Host ===== | ||
- | |||
- | SSH to a bastion host that is public facing and hopping from there to systems with private addresses only. | ||
- | |||
- | * Pre-req Setup complete | ||
- | * Start SSH Agent< | ||
- | * Add key to the agent< | ||
- | * SSH to the bastion host, forwarding the pem key | ||
- | * AWS Linux AMI<code bash>ssh -A ec2-user@public.ip.address.here</ | ||
- | * CentOS AMI<code bash>ssh -A centos@public.ip.address.here</ | ||
- | * Now on bastion host, SSH to the private address only instance | ||
- | * AWS Linux AMI<code bash>ssh ec2-user@private.ip.address.here</ | ||
- | * CentOS AMI<code bash>ssh centos@private.ip.address.here</ | ||
- | |||
- | ---- | ||