Skip to content

Instantly share code, notes, and snippets.

@rupakraj
Last active May 21, 2017 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rupakraj/5b26a591293038aa1b3002eabe3c9daf to your computer and use it in GitHub Desktop.
Save rupakraj/5b26a591293038aa1b3002eabe3c9daf to your computer and use it in GitHub Desktop.
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/ur_pub_file.pub username@IP:~/.ssh/authorized_keys
OR
$ 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