- VPS manager: Digital Ocean
- OS: Ubuntu 20.04.1 LTS
- Size: 1CPU, 2GB RAM, 50GB SSD, 2TB data (to upsize later when needed)
- Datacenter Region: London
- IP:
- hostname:
- ports:
- domain: Freenom
- usrname:
- ssh-key:
- grpname: public
- public folder:
/usr/local/share/public
-
$R$ packages folder:/usr/local/share/public/R_library
-
create machine
-
first connection: change root password (if not automatic, run
passwd
) -
check/change timezone
-
update/upgrade/dist-upgrade the system
-
add DO monitoring:
curl -sSL https://agent.digitalocean.com/install.sh | sh
-
install missing default packages:
apt-get install -y apt-transport-https software-properties-common dos2unix man-db ufw git-core nano libauthen-oath-perl openssh-server
-
add user(s) to system:
adduser luca
-
add user(s) to sudo group:
usermod -aG sudo luca
==> check -
configure git for new user(s):
git config --global user.name "Luca Valnegri" git config --global user.email "[email protected]"
-
add public group:
sudo groupadd public
-
add user(s) to group:
sudo usermod -aG public luca
-
add public repository
sudo mkdir -p /usr/local/share/public/ sudo chgrp -R public /usr/local/share/public/ sudo chmod -R 2775 /usr/local/share/public/
-
set public repo in
/etc/environment
as PUB_PATH -
reboot:
sudo reboot
-
add subfolders
software
andscripts
tohome
folder -
add subfolders
subs
andr_packages
toscripts
subfolder -
cd subs
then download from pastebin the files 916041fv as public_subs.sh and zbzDnuHb as public_subs.lst:
wget -O public_subs.sh https://pastebin.com/raw/916041fv
wget -O public_subs.lst https://pastebin.com/raw/zbzDnuHb
-
convert to UNIX format:
dos2unix public_subs.lst public_subs.sh
or simplydos2unix *
-
make public_subs.sh executable:
chmod +x public_subs.sh
-
run public_subs.sh to add subfolders to public repo:
./public_subs.sh
-
follow the same steps as above to create subfolders in the home folder:
wget -O home_subs.sh https://pastebin.com/raw/XThRT4u4
wget -O home_subs.lst https://pastebin.com/raw/Ze6M1snP
-
deny the
root
user direct access via SSH:sudo nano /etc/ssh/sshd_config
(restart SSH + check) -
change port to SSH:
sudo nano /etc/ssh/sshd_config
(restart SSH + check) -
enable the default firewall UFW:
sudo ufw enable
(check) -
allow (new) SSH port:
sudo ufw allow XYYYY
(check) -
install antivirus ClamAV:
sudo apt-get install -y ClamAV
-
install webmin / allow port 10000 (check, remember it's only on
https
) -
redirect http / change port / allow new port / delete previous port rule (check)
-
add 2FA
-
add a domain name
-
take a snapshot