Some basic linux commands
- For remote access to a virtual machine, sometimes you need to enable
access to certain port, here is how to do so on Ubuntu
- Allowing TCP/UDP access to port on Ubuntu:
sudo ufw allow <port>
- Allowing Http on port 80:
sudo ufw allow http
orsudo ufw allow 80
- Allow Https on port 443:
sudo ufw allow https
orsudo ufw allow 443
- Delete a rule:
sudo ufw status numbered
, thensudo ufw delete <number>
- Allowing TCP/UDP access to port on Ubuntu:
- Check whcich application is listening to a port:
netstat -nltp | grep <port>
. If you meet an error like thisbash: netstat: command not found
, then you need to install thenet-tools
package first:sudo apt install net-tools