Skip to content

Instantly share code, notes, and snippets.

@od3n
Created May 15, 2014 09:04
Show Gist options
  • Save od3n/5a43ac7abd7a7a2919f1 to your computer and use it in GitHub Desktop.
Save od3n/5a43ac7abd7a7a2919f1 to your computer and use it in GitHub Desktop.
# login to your droplet
ssh root@<ip-address>
# change root password
passwd
# create new user
adduser -c "New User Description" -m <user>
# set new user password
passwd <user>
# set new user root priviligies
visudo
# look for root priviligies ( root ALL=(ALL) ALL) and write
<user> ALL=(ALL) ALL
# save and close
ESC + ZZ
# change ssh port
vi /etc/ssh/sshd_config
# Set the next parameters
Port <port-number>
Protocol 2
PermitRootLogin no
UseDNS no
AllowUsers <user>
# save and close
ESC :qw
# reload ssh
/etc/init.d/sshd reload
# test your new ssh connection
ssh -p <port> <user>@<ip-addres>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment