Last active
May 21, 2017 10:42
-
-
Save rupakraj/5b26a591293038aa1b3002eabe3c9daf to your computer and use it in GitHub Desktop.
Configuring vps for first time (reference ubuntu)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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