Skip to content

Instantly share code, notes, and snippets.

@sloppycoder
Created August 23, 2017 18:50
Show Gist options
  • Select an option

  • Save sloppycoder/6cba6edc4e95d4cb2bb39a7efe8caf95 to your computer and use it in GitHub Desktop.

Select an option

Save sloppycoder/6cba6edc4e95d4cb2bb39a7efe8caf95 to your computer and use it in GitHub Desktop.
redirect port on linux
# redirect port < 1024 to other ports so that server process can run as non-root
# localhost/loopback
sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 8443
# external
sudo iptables -t nat -I PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 8443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment