Skip to content

Instantly share code, notes, and snippets.

@aaronromeo
Last active August 29, 2015 14:04
Show Gist options
  • Save aaronromeo/7969396f107ffea4e298 to your computer and use it in GitHub Desktop.
Save aaronromeo/7969396f107ffea4e298 to your computer and use it in GitHub Desktop.
Useful commands for initial Ubuntu server setup

Update the default editor so we aren't living in squalor

> sudo update-alternatives --config editor

Update the root password and add the hotstuff user

> passwd
> adduser hotstuff
> visudo

Then add the line

# User privilege specification
root    ALL=(ALL:ALL) ALL
hotstuff  ALL=(ALL:ALL) NOPASSWD: ALL

Secure the SSH shell from bastards

> vi /etc/ssh/sshd_config

Update the lines in this file like so...

Port 1234 # A random number between 1025 and 65536
...
PermitRootLogin no
...
AllowUsers hotstuff # You'll probably need to add this line

To copy over the SSH key (this is done from the local machine)

ssh-copy-id hotstuff@{server-name}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment