post(busybox-aws): encrypt ssh key

This commit is contained in:
MDLeom 2020-10-21 09:12:37 +00:00
parent 92153f9189
commit 62a7c02da2
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 18 additions and 0 deletions

View File

@ -161,6 +161,24 @@ $ aws ec2 describe-instances --profile ec2 \
$ ssh server1
```
### Encrypt private key
AWS generates a private key without any encryption by default, to secure it with a password:
```
$ ssh-keygen -p -f /home/example/.ssh/private_key.pem
Enter new passphrase (empty for no passphrase): ****
Enter same passphrase again: ****
Your identification has been saved with the new passphrase.
```
SSH will prompt for password after this:
```
$ ssh server1
Enter passphrase for key '/home/example/.ssh/private_key.pem': ****
```
## kitty compatibility
If you use [kitty](https://sw.kovidgoyal.net/kitty/index.html) terminal to ssh into your Linux instance, you may find the backspace doesn't work. That is because kitty uses different terminfo.