AWS – New server setup

I frequently setup instances on AWS and have to do a bunch of configuration to allow ssh access. Here’s a list of things that need to be done:

1. First time login with private key

ssh -i .ssh/your-private-key.pem admin@IP-Address

2. Change hostname – Changing hostname on Jessie build is fairly straightforward.

hostnamectl set-hostname your-new-hostname

Restart the hostname service within /etc/init.d or logout and log back into session

3. Allow ssh without private key – Modify the sshd_config file and make sure the following setting is enabled

PasswordAuthentication yes

Save the file and exit. Restart the ssh services within /etc/init.d

./ssh restart

4. Add new user – Use the following command as opposed to useradd and follow the prompts

adduser username

5. Add sudo privileges to username – Add sudo privileges without password to the /etc/sudoers file

# User privilege with no password
username     ALL=NOPASSWD:ALL

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s