Commonly used commands on Ubuntu Server
Enable firewall
sudo ufw enable
Check firewall status
sudo ufw status verbose
Open ports
sudo ufw allow ssh
# OR (more explicitly)
sudo ufw allow 22/tcp
# Open ports in a range
sudo ufw allow <start_port>:<end_port>/<protocol>
Delete port from firewall
sudo ufw delete allow 22/tcp # Removes the rule allowing SSH on port 22
Config Apache Maven with command line
# Add maven home
echo 'export M2_HOME=/your/maven/home/directory' >> ~/.bashrc
# Add maven path
echo 'export PATH=${M2_HOME}/bin:${PATH}' >> ~/.bashrc
Restart terminal, should use mvn -v
to verify configuration