Create multiple Linux accounts on Amazon EC2
On LOCAL:
[pwang@r710 .ssh]$ ssh-keygen -b 1024 -f <USER_ACCOUNT> -t dsa
Generating public/private dsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in <<USER_ACCOUNT>.
Your public key has been saved in <USER_ACCOUNT>.pub.
The key fingerprint is:
ff:85:c1:4f:8c:26:54:2f:62:19:81:b7:9a:71:db:19 pwang@r710
The key's randomart image is:
+--[ DSA 1024]----+
| .o.. |
| . .+ . |
| .=.. . |
| .oooE+ |
| S=.o=oo |
| o..oo= |
| . . o |
| . . |
| . |
+-----------------+
[pwang@r710 .ssh]$ chmod 600 <USER_ACCOUNT>.pub
(It is the publick key which will be copied into authorized_file on EC2)
[pwang@r710 .ssh]$ chmod 600 <USER_ACCOUNT>
(It is the private key)
On AMAZON:
as root:
# useradd <USER_ACCOUNT>
# su - <USER_ACCOUNT>
# mkdir .ssh && chmod 700 .ssh
# cd .ssh
# vi authorized_keys
Copy and pasted the public key created on local into authorized_keys
From local:
[pwang@r710 .ssh]$ ssh -i <USER_ACCOUNT_PRIVATE> pwang@AMAZON_EC2
Last login: Mon Jan 22 22:39:38 2018
[pwang@AMAZON ~]$
Comments