How to add IP restrictions to my amazon ec2 instance installed with ubuntu 12

0

I have to add IP restrictions to my amazon EC2 instance , The reason for doing it is , I dont want to allow to do ssh from all places , it should be allowed only from my ip address. I am new to amazon , Please kindly provide some instructions regarding this

Thanks in advance for responding to this

aravind.udayashankara

Posted 2012-09-29T11:28:35.553

Reputation: 185

Answers

2

Have you read this article: Tips for Securing Your EC2 Instance? I believe it has the information you need.

You should authorise your IP address (e.g. assuming your IP address is 1.2.3.4):

PROMPT> ec2-authorize default -p 22 -s 1.2.3.4

And then simply create SSH key pairs for all your users and authorise the public key of the pairs with the ec2-add-keypair command as described in the Ditch Those Passwords: Use ssh Keys of the above mentioned article. This way only the users with authorised SSH key pairs from the authorised IP will be able to connect.

Pedro Romano

Posted 2012-09-29T11:28:35.553

Reputation: 363

Yup I had read that , But I have several users created and I want all of them to use the same my office ip address to do ssh , how I can do that – aravind.udayashankara – 2012-09-29T11:40:56.380

@aravind.udayashankara: added more details for possible solution. – Pedro Romano – 2012-09-29T11:50:05.687