[tecmint.com complete guide to users](http://www.tecmint.com/add-users-in-linux/)
[How To Configure SSH Key-Based Authentication on a Linux Server](https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server)
#### postgres
[ubuntu community postgres docs](https://help.ubuntu.com/community/PostgreSQL)
1. Open the [amazon EC2 console](https://console.aws.amazon.com/ec2/)
2. Choose **Launch Instance**
3. The *Choose an Amazon Machine Image (AMI)* page has basic configuration, so pick the first *ubuntu* configuration
4. This will take you to the *Choose an Instance Type* page, this chooses the hardware configuration, you want to pick **t2.micro**
5. Hit **Review and Launch**
6. This will take you to *Review Instance Launch* page, and that has an option for **Security Groups**, hit **Edit security groups**, on the page that pops up, pick the options you want to allow for your instance
7. When finished, hit "done" or whatever and you'll be taken back to the *Review Instance Launch* page, from here hit the **Launch** key
8. this will prompt you for a key pair. There are a few options. Create a new Pair and choose an existing key pair
####key pair info:
[aws info on key pairs](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html)
[scroll down to find the "echo" comment](https://forums.aws.amazon.com/message.jspa?messageID=495274)
there is an issue with ubuntu instances on AWS, the name given in /etc/hostname doesn't match what exist in /etc/hosts. So if you try using sudo you'll get an error.
To fix this, you need to change those files, to get into sudo type in:
sudo su -
echo "127.0.0.1 $(hostname)" >> /etc/hosts
This will update /etc/hosts with the default hostname generated by amazon. Alternatively you can do what it says in the first link [aws ubuntu hostname](https://aws.amazon.com/premiumsupport/knowledge-center/linux-static-hostname/)
### setup visudo
sudo update-alternatives --config editor
su -c 'visudo'
find this line:
USERNAME ALL=(ALL) NOPASSWD: ALL
replace it with:
admin ALL=(ALL) ALL
## add new user
[adding a user on linux AWS](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/managing-users.html)
[how to get an add the public key to the new user](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#retrieving-the-public-key)
In order to use ssl/https it is necessary to install a certificate. This is especially true if the nginx config file has *already* been set up to use ssl. (for example, you are reinstalling an environment, or creating production based on staging, etc)
[certbot.eff.org](certbot.eff.org) allows you to install a free certificate
#### add certbot ppa
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
#### install certbot
sudo apt-get install certbot python-certbot-nginx
#### Choose how you'd like to run certbot
##### OPTION1: get and install your certificates
sudo apt-get install certbot python-certbot-nginx
##### OPTION2: just get the certificate (already configured)
sudo certbot --nginx
Use Option1 when you are just starting a project, but you know you are going to be using SSL
Use Option2 when you have already set up nginx to work with https, for example, you are reinstalling an existing project, etc.