Friday, October 12, 2012

Cloud-based private VPN part 1

I have been working on this for a while now, and it is still not complete  This is Part 1 of 2, as soon as I have the last steps in place, I'll post it.

Below is the site I ran across and started updating the instructions here in my blog.

http://www.stratumsecurity.com/2010/12/03/shearing-firesheep-with-the-cloud/

Here is another blog to help along the way.
http://expedienttech.net/?p=68

Starting from the Beginning,
 This is a step by step direction on how I set up my vpn.

I Created an account with Amazon EC2,

Input my Information with my name, mailing address, etc and a credit card number so if i want to upgrade they can charge me. 

After you have created an account, click on the "My Account/Console" and select "AWS Managment Console",  as seen below.



Then you will come to this page. Click on the "EC2" icon.


That takes you to this page, where on the left hand side, underneath the "Networking & Security" you need to click "Key Pairs".


You will see this page, and need to click on the "Create Key Pair"


Enter the Name of your VPN connection and click "Create"
Then you will see this window with the completed message, 
and it will download your key to your download file.


Close the window, then you will  see this window.


Click the EC2 Dashboard on the left hand side of the screen, and click the Launch Instance, like the picture below


You will see this screen,


On the Left hand side select "Quick Launch Wizard", Scroll down and select "Ubuntu Server 12.04 LST" and click "continue",


Now you need to set up your "Security Group", you need to click "Edit Details",


This is the screen you will see, click on the "Security Settings" from the selections,


Then Click "Create New Security Group"


In the "Group Name" field, type "InternetAccessible", under the "Description" type "Service Allowed from the Internet", on the drop down menu select "SSH", Click "Add Rule",


Just use the Default setting, Which for me appeared as a drop down menu option, then click add rule,and then scroll up and click create,


Then Click "Save Details"


Next click the "Launch" button.


Then you will see this page telling you that your Instance is now launched. Click the "Close" button.


 Now on the left hand side of the screen, Click the "Elastic IPs" 
and click the "Allocate New Address" button 


Click "Yes, Allocate",


Click "Associate Address" button,


On the Drop down click the name of your Instance, click "Yes,Associate"


Take Note of Your IP as you will be needing it.


You will need to download PuTTY and PuTTYgen to SSH into your Instance,
here is the link to download it.


 Amazon has already documented how to SSH into your Ubuntu Instance,
the  first link is the directions how to do so in Windows 


After you have connected you will see a window Welcoming you to Ubuntu


We need to change that password on the Ubuntu instance,
type sudo su - 
hit enter
type passwd ubuntu
hit enter, then type your new password twice
Then we need to change the password for root
type passwd
hit enter, and enter your root password twice,


 type exit,
hit enter, then type sudo apt-get update


after that is finished, type sudo apt-get upgrade

  
 update your time zone by typing sudo dpkg-reconfigure tzdata
follow the instructions and use your arrow keys to move to your different options.


It's time to reboot the system, type sudo reboot now
and wait about 2 minutes before tryinng to reconnect to it.

After it had been rebooted, 
type sudo apt-get -y install openvpn libssl-dev openssl
Let that install, then type cd /etc/openvpn/
hit enter
type  sudo mkdir easy-rsa
hit enter,then type
sudo cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0/* /etc/openvpn/easy-rsa/
again hit enter, and type
sudo chown -R $USER /etc/openvpn/easy-rsa/
hit enter and type  cd /etc/openvpn/easy-rsa/
Make sure to read the termanal, and make sure you have no errors,
In the Picture below, I mistyped a command and it told me the Directory wasn't created,
I found my error and fixed it, and didn't have a problem after that


We now need to set our 'vars' file up and input our SSL certificate information.
We will be using Vi as our editor, if you haven't worked with it before check out this tutorial.
 Type sudo vi vars
 hit enter

 I used my arrow keys to scan down the Vi editor page and found the fields I was looking for.


Here is the list of changes you need to make, you will want to type i to start input mode

Change export ‘KEY_SIZE=1024′ to ‘export KEY_SIZE=2048′
Change export KEY_COUNTRY=”US” to your country.
Change export KEY_PROVINCE=”CA” to your state.
Change export KEY_CITY=”SanFrancisco” to your city.
Change export KEY_ORG=”Fort-Funston” to your organization or something else.
Change export KEY_EMAIL=”me@myhost.mydomain” to your email address.


After you are done inputting your data hit the ESC button on the keyboard, 
then type :wq to quit the Vi editor.



I am Finishing up my research and implementation of this
and
I will post the rest of the instructions as soon as I'm done.