X

How to : Creating new user in AWS linux EC2 instance and accessing it through putty

When you create an instance on amazon you are able to login only through the user for which private key is supplied , But sometimes it is required to create an user and key is needed for the same.Here we explain how creating new user in aws linux EC2 instance and accessing it through putty.

STEPS TO CREATE KEY

Step 1 :- Firstly , add user (Supposing , the new username is abc)

#useradd -m abc

Step 2 :- Assign password for the user

# passwd abc 

Enter new UNIX password:
Retype new UNIX password:

passwd: password updated successfully

Step 3 :- Then switch the user to abc

# su abc

Step 4 :- Now generate ssh key for the user abc.

$ ssh-keygen -t dsaGenerating public/private dsa key pair.
Enter file in which to save the key (/home/abc/.ssh/id_dsa):Created directory '/home/abc/.ssh'.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:Your identification has been saved in /home/abc/.ssh/id_dsa.

Your public key has been saved in /home/abc/.ssh/id_dsa.pub.

The key fingerprint is:

32:6d:1f:85:0f:a1:b6:5a:a5:b2:9f:35:71:08:ce:48 abc@ip-172-31-17-76

The key's randomart image is:

+--[ DSA 1024]----+

|          .      |

|         . o     |

|      E + + .    |

|     . * = =     |

|      = S + o    |

Step 5 :- After Generating the ssh key append the public key  id_dsa.pub to authorized_key file.

#cd /home/abc/# cd .ssh
# ls 

id_dsa  id_dsa.pub

# mv id_dsa.pub authorized_keys

Step 6 :- Copy private key file id_dsa  and generate the ppk key from it (ppk is readable from putty):-

Please follow the following link for the same

http://www.technologycake.com/2013/06/11/generate-ppk-key-to-access-linuxunix-instance-on-amazon/

Step 7 :- Now open putty and use abc.ppk to login.

Step 8 :- Login with user abc

 

 

 

 

  • Tags: creating user in linux ec2, creating user in linux with key authentication, new user in linux ec2, ppk for new user in aws,