Skip to content

Instantly share code, notes, and snippets.

@UddeshJain
Last active June 5, 2020 16:00
Show Gist options
  • Save UddeshJain/dd418d63e1f308b0902f70a14f101d0d to your computer and use it in GitHub Desktop.
Save UddeshJain/dd418d63e1f308b0902f70a14f101d0d to your computer and use it in GitHub Desktop.

Loging in to server

ssh -i your_private_key username@ipv4

Seting up the server

1. sudo apt update

2. sudo apt upgrade

3. adduser user_name

4. usermod -aG sudo user_name

5. su user_name

6. cd ~

7. mkdir -p ~/.ssh

8. sudo nano ~/.ssh/authorized_keys       // paste your local system public key in this file

9. exit from server and try to login as new user with your ssh key

10. sudo chmod 644 ~/.ssh/authorized_keys

11. sudo nano /etc/ssh/sshd_config

12. Now chage the line "PermitRootLogin yes" to "PermitRootLogin no"

13. sudo service sshd restart

14. sudo apt install nginx

15. sudo service nginx start

16. Install nodejs

17. sudo chown -R $USER:$USER /var/www

18. mkdir /var/www/app

After setting and starting on node or react app proxy paas to different ports

1. sudo nano /etc/nginx/sites-available/default

Extra security settings

1. sudo apt install unattended-upgrades

Setting up fireball

1. sudo ufw status

2. sudo ufw start

3. sudo ufw allow ssh

4. sudo ufw allow http
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment