0%

Linux Knowledge

Some basic linux commands

  1. 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 or sudo ufw allow 80
    • Allow Https on port 443: sudo ufw allow https or sudo ufw allow 443
    • Delete a rule: sudo ufw status numbered, then sudo ufw delete <number>
  2. Check whcich application is listening to a port: netstat -nltp | grep <port>. If you meet an error like this bash: netstat: command not found, then you need to install the net-tools package first: sudo apt install net-tools