# Persistence

## AWS EC2 Persistence

#### All the persistence techniques work here, SSH persistence, vim backdoor, etc.

## Example: SSH

**1) Generate SSH Key pair**

```
ssh-keygen
```

**2) Add public key to authorized\_keys**

```
echo "PUBLIC_Key" >> /home/user/.ssh/authorized_keys
```

**3) Use the private key to connect**

```
ssh -i PRIVATE_KEY USER@INSTANCE
```
