sudo apt update
sudo apt upgrade -y
- modify /etc/ssh/sshd_config
- find the
PasswordAuthentication
line, then uncomment or setPasswordAuthentication
toyes
...
-PasswordAuthentication no
+PasswordAuthentication yes
...
In a web application environment, user facing ports should only be ssh, http, and https.
sudo ufw enable
sudo ufw status # check if active
sudo ufw allow ssh # or 22
sudo ufw allow http # or 80
sudo ufw allow https # or 443
sudo ufw status # check if ssh, http, and https are allowed anywhere
please ask for assistance for the linux username
sudo adduser <username>
sudo passwd <username> # if password is never prompted
sudo usermod -aG sudo <username> # give user the sudoer's privilege
su <username>
- restart ssh service
sudo service ssh restart
The following steps should be done using the newly created user
sudo apt update
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
nginx -v
make sure the output is like this: nginx version: nginx..
otherwise ask for assistance
sudo apt update
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update # get update from add-apt-repository and others
sudo apt install php7.4 -y
sudo apt install php7.4-{cli,common,curl,zip,gd,mysql,xml,mbstring,json,intl} -y
php -v
make sure the output is like this: PHP 7.4..
otherwise ask for assistance
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo usermod -aG docker $USER
sudo service docker start
sudo docker compose up -d