Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Configuring vps for first time (reference ubuntu)
# OS: Ubuntu
## Basic Configuration
-- login using ssh
# ssh root@IP
-- Update latest updates/security patches
-- set timezone
# timedatectl set-ntp true
# dpkg-reconfigure tzdata
-- Add new user -
$ adduser username
Give sudo permission
$ adduser username sudo
-- SSH using new user
ssh username@IP
## Security
- create your ssh key
- add your public key using secure copy (scp)
$ scp ~/.ssh/ username@IP:~/.ssh/authorized_keys
$ ssh-copy-id username@IP
- NOW, SSH using key instead of password
$ ssh username@IP
- OPTIONAL: Remove root login using password
$ nano /etc/ssh/sshd_config
Find PermitRootLogin and set no
- Restart SSH
$ sudo service ssh restart
- Check currently running services on vps
$ sudo netstat -tulpn
## Configure IPTable
- Yet to configure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment