Last active
August 29, 2015 14:00
-
-
Save nickfogle/11295497 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# **AWS EC2 Instance Manager** | |
## Modify Key Security | |
> | |
``` | |
chmod 600 key.pem | |
``` | |
## Connect to instance | |
> | |
``` | |
ssh -i key.pem ubuntu@ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com | |
``` | |
## Setup Root User | |
> | |
``` | |
sudo vi /etc/ssh/sshd_config | |
``` | |
> | |
``` | |
sudo useradd -d /home/nick -m nick | |
``` | |
> | |
``` | |
sudo passwd nick | |
``` | |
> | |
``` | |
sudo visudo | |
``` | |
**After line "root ALL=(ALL:ALL) ALL", add "nick ALL=(ALL:ALL) ALL"** | |
> | |
``` | |
sudo su - | |
``` | |
> | |
``` | |
service ssh restart | |
``` | |
> | |
``` | |
logout | |
``` | |
**Login as new user and notice the default bash is gone, to fix this:** | |
> | |
``` | |
sudo chsh -s /bin/bash | |
``` | |
**if that doesn't work you'll need to edit the passwords file** | |
> | |
``` | |
sudo su - nano /etc/passwd | |
``` | |
**after your new user, add** | |
> | |
``` | |
/bin/bash | |
``` | |
## Permanently Add an Alias | |
> | |
``` | |
nano ~/.bashrc | |
``` | |
**Add alias after last line in your terminal** | |
**Then execute below (space between the . and ~/.bashrc.)** | |
> | |
``` | |
. ~/.bashrc | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment