Last active
July 9, 2018 08:15
-
-
Save stories2/ec21338deb3a8464c534e32773ada56c to your computer and use it in GitHub Desktop.
Revisions
-
stories2 revised this gist
Jul 9, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -212,5 +212,6 @@ vim /etc/rc.local ``` And type this command ``` source /etc/profile forever /home/stories2/Kiosk-Node-Server/index.js & ``` -
stories2 revised this gist
Jul 9, 2018 . 1 changed file with 14 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -75,6 +75,9 @@ node -v ``` sudo npm install [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] ``` ``` npm install forever --global ``` ### Setup env vars ``` @@ -199,4 +202,15 @@ vim /etc/sudoers - Type these down below `root ALL=(ALL:ALL) ALL` ``` <USER ID> ALL=(ALL:ALL) ALL ``` ## Startup autorun backend server program ### Setup startup file ``` vim /etc/rc.local ``` And type this command ``` forever /home/stories2/Kiosk-Node-Server/index.js & ``` -
stories2 revised this gist
Jul 9, 2018 . No changes.There are no files selected for viewing
-
stories2 revised this gist
Jul 9, 2018 . No changes.There are no files selected for viewing
-
stories2 revised this gist
Jul 9, 2018 . 1 changed file with 14 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -185,4 +185,18 @@ allow_writeable_chroot=YES ### Restart FTP ``` systemctl restart vsftpd ``` ## Add new user ``` adduser <USER ID> ``` ### Set user can use super user permission ``` vim /etc/sudoers ``` - Type these down below `root ALL=(ALL:ALL) ALL` ``` <USER ID> ALL=(ALL:ALL) ALL ``` -
stories2 revised this gist
Jul 9, 2018 . 1 changed file with 30 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -156,3 +156,33 @@ apt-get install xinetd telnetd ufw allow <PORT NUMBER> ``` ## Install FTP ### Install FTP ``` apt-get update apt-get install vsftpd ``` ### Backup conf ``` cp /etc/vsftpd.conf /etc/vsftpd.conf.orig ``` ### Edit conf ``` vim /etc/vsftpd.conf ``` #### Edit conf ``` #write_enable=YES --> write_enable=YES #chroot_local_user=YES --> chroot_local_user=YES #utf8_filesystem=YES --> utf8_filesystem=YES allow_writeable_chroot=YES ``` ### Restart FTP ``` systemctl restart vsftpd ``` -
stories2 revised this gist
Jul 9, 2018 . 1 changed file with 25 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -131,3 +131,28 @@ flush privileges; ``` ## Install telnet ### Install telnet ``` apt-get install telnet apt-get install xinetd telnetd ``` ### Check telnet status ``` /etc/init.d/xinetd status ``` ### Restart telnet ``` /etc/init.d/xinetd restart ``` ## Setup ufw - [Reference](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-16-04) ### Allow specific port ``` ufw allow <PORT NUMBER> ``` -
stories2 revised this gist
Jul 9, 2018 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -124,7 +124,10 @@ bind-address = 127.0.0.1 --> bind-address = 0.0.0.0 ``` #### Add permission to user - [Reference](http://link2me.tistory.com/431) ``` grant all privileges on *.* to root@'%' identified by <PASSWORD>; flush privileges; ``` ## Install telnet -
stories2 revised this gist
Jul 9, 2018 . 1 changed file with 53 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -74,4 +74,57 @@ node -v ### Install dependencies ``` sudo npm install [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] ``` ### Setup env vars ``` vim /etc/profile ``` #### Write env vars - Goto bottom and type these ``` export PAPERTRAIL_API_TOKEN=<TOKEN> export PUSH_SERVER_PRIVATE_KEY=<PRIVATE KEY> export PUSH_SERVER_PUBLIC_KEY=<PUBLIC KEY> ``` ### Update env vars ``` source /etc/profile ``` ### Test Run backend program ``` node index.js ``` ## Install Mysql 5.7 ### Install Mysql ``` apt-get update apt-get install mysql-server=5.7.22-0ubuntu0.16.04.1 mysql_secure_installation ``` ### Check is Mysql process running ``` systemctl status mysql.service ``` ### Setup enable remote access ``` vim /etc/mysql/mysql.conf.d/mysqld.cnf ``` #### Edit conf ``` bind-address = 127.0.0.1 --> bind-address = 0.0.0.0 ``` #### Add permission to user ``` grant all privileges on *.* to root@'%' identified by <PASSWORD>; flush privileges; ``` -
stories2 revised this gist
Jul 9, 2018 . 1 changed file with 36 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -38,4 +38,40 @@ ssh <USER ID>@<SERVER IP ADDRESS> #### Example ``` sssh [email protected] ``` ### Install latest npm, nodejs ``` apt-get update apt-get install nodejs apt-get install npm ``` ### Check npm version ``` npm -v ``` ### Check node js version ``` nodejs -v ``` ### Install specific version of node ``` wget https://nodejs.org/dist/v6.11.5/node-v6.11.5-linux-x64.tar.gz mkdir -p /opt/nodejs tar -xvzf node-v6.11.5-linux-x64.tar.gz -C /opt/nodejs/ cd /opt/nodejs/ mv node-v6.11.5-linux-x64 6.11.5 ln -s 6.11.5 current ln -s /opt/nodejs/current/bin/node /bin/node node -v ``` ## Server Program setting ### Install dependencies ``` sudo npm install [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] ``` -
stories2 revised this gist
Jul 9, 2018 . 1 changed file with 26 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,4 +12,30 @@ apt-get upgrade ``` netstat -ntlp | sshd service ssh status ``` ### Install sshd service ``` apt-get install openssh-server ``` ### Restart sshd service ``` service ssh restart service ssh status ``` ### Check process TCP network status ``` netstat -nap | grep tcp ``` ### How to connect to server using ssh ``` ssh <USER ID>@<SERVER IP ADDRESS> ``` #### Example ``` sssh [email protected] ``` -
stories2 revised this gist
Jul 9, 2018 . 1 changed file with 9 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,14 @@ ### Check network ```ifconfig -a``` ### Check update & install upgrade ``` apt-get update apt-get upgrade ``` ### Check is ssh installed ``` netstat -ntlp | sshd service ssh status ``` -
stories2 revised this gist
Jul 9, 2018 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,10 @@ ## After boot ### Check network ```ifconfig -a``` ### Check update & install upgrade ```apt-get update apt-get upgrade``` ### Check is ssh installed ```netstat -ntlp | sshd service ssh status``` -
stories2 created this gist
Jul 9, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ ## After boot ### Check network `ifconfig -a` ### Check update & install upgrade `apt-get update` `apt-get upgrade`