Skip to content

Instantly share code, notes, and snippets.

@bitfidget
Created July 29, 2014 03:14
Show Gist options
  • Save bitfidget/09a79f0cf521b650bfd6 to your computer and use it in GitHub Desktop.
Save bitfidget/09a79f0cf521b650bfd6 to your computer and use it in GitHub Desktop.
setting up aws dev environment

firstly - yuck.

-- connect to server in terminal:

  • ssh userame@server

Enter password when prompted. If you need to chnage your password, at this point, enter:

  • passwd

And enter your OLD password, follwed by your new password when prompted.

-- update hosts file

It's a good idea at this poitn to also update your local hosts file so you're able to browse to your server instance at a URL which is both more meaningful and easier(shorter) than the defauls AWS domain which is provided. Open your local hosts file (~/etc/hosts) and add a new line:

IPaddress_of_server new_desired_url

eg if your server is thisproject-dev001-au1.exmple.com.au and is at 13:12:344:432, go with something like:

13:12:344:432 thisproject

-- connect public key (so you dont need to keep entering your password)

Once connected to the host via ssh enter

  • mkdir ~/.ssh

  • echo ssh-rsa ENTERYOURREDICULOUSLYLONGPUBLICKEYHERE >> ~/.ssh/authorized_keys

  • ls -ls ~/.ssh

The last command should return something about your username havign authorised keys (eg. 4 -rw-rw-r-- 1 username username 419 Jul 29 13:01 authorized_keys). Now you need to change some file permissions, so do these:

  • ls -ld ~/.ssh
  • chmod 0700 ~/.ssh
  • ls -ls ~/.ssh
  • chmod 0600 ~/.ssh/authorized_keys
  • ll ~/.ssh/authorized_keys
  • I realise that some of the above commands are superfluous but these notes are quickly thrown togeher while following along from an example. I will hopefull work out what all this means one day!

You can now ctrl D to logout of the current ssh connection, and try logging in again - you should just login, without need for password!

-- Upload MySQL DB

Firstly check that mysql is actually installed -ssh into your server again, enter mysql and hit tab - you should see a bunch of mysql commands.

  • cd /etc/init.d

And then... go search somehwere else on how to do this cos I just lost the terminal wondow that had all these instrctions in it! grr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment