post-up iptables -t nat -A PREROUTING -d <your-ip> -p tcp --dport 443 -j REDIRECT --to-port 8006 || true
Does this will change port so hacker can not access 8006 anymore?You can also change it via iptables, e.g. add this to your network device in /etc/network/interfaces:
Code:post-up iptables -t nat -A PREROUTING -d <your-ip> -p tcp --dport 443 -j REDIRECT --to-port 8006 || true
This guide is useless, because I still can access 8006, so do the Hacker sir and put nginx mean give more oppurtunity for hacker, also make additional server load
Then you need another iptables rule.Does this will change port so hacker can not access 8006 anymore?
You should not expose the port to the world, so as long as it faces to the public, it can be attacked independend of the used port. There are only 65536 ports that are blazingly fast scanned for a running HTTP(s) server.This guide is useless, because I still can access 8006, so do the Hacker sir and put nginx mean give more oppurtunity for hacker, also make additional server load
Corect!You should not expose the port to the world, so as long as it faces to the public, it can be attacked independend of the used port
Good points @guletz, but you forgot
0. Use a static IP as a client and allow only that IP through your PVE firewall.
Great idea!!! Thanks3. More secure then 1. and 2(IMHO)
- Mikrotik as border router
- access on border router only for a few DDNS clients(admin PC) who will be able to connect with a VPN to any PMX host
Hi,Great idea!!! Thanks
Any guide and/or tip on implementing this access restriction on software for not-Mikrotik users?
# Change Proxmox default port
sed -i 's|8006|443|g' /usr/share/perl5/PVE/Firewall.pm
sed -i 's|8006|443|g' /usr/share/perl5/PVE/Cluster/Setup.pm
sed -i 's|8006|443|g' /usr/share/perl5/PVE/APIServer/AnyEvent.pm
sed -i 's|8006|443|g' /usr/share/perl5/PVE/API2/LXC.pm
sed -i 's|8006|443|g' /usr/share/perl5/PVE/API2/Qemu.pm
sed -i 's|8006|443|g' /usr/share/perl5/PVE/APIClient/LWP.pm
sed -i 's|8006|443|g' /usr/share/perl5/PVE/CLI/pct.pm
sed -i 's|8006|443|g' /usr/share/perl5/PVE/CLI/qm.pm
sed -i 's|8006|443|g' /usr/share/perl5/PVE/Service/pveproxy.pm
echo 'net.ipv4.ip_unprivileged_port_start=0' > /etc/sysctl.d/50-unprivileged-ports.conf
reboot
There is no "Proxmox". Proxmox VE uses 8006 and Proxmox Backup Server 8007. And you can run both in parallel bare metal on the same host. Wouldn't work if both webUIs would use the default port 443.Why does Proxmox use port 8006 instead of the standard port 443?
That doesn't look like a reliable solution. I would guess a upgrade could revert your changes and might even lock you out from the webUI.Code:# Change Proxmox default port sed -i 's|8006|443|g' /usr/share/perl5/PVE/Firewall.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/Cluster/Setup.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/APIServer/AnyEvent.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/API2/LXC.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/API2/Qemu.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/APIClient/LWP.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/CLI/pct.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/CLI/qm.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/Service/pveproxy.pm echo 'net.ipv4.ip_unprivileged_port_start=0' > /etc/sysctl.d/50-unprivileged-ports.conf reboot
Looks much easier and better maintainable than just using one iptables from above.After a lot of digging, found out that I can reset the webui to run on port 443 like it used to in Proxmox 2 and earlier. As this is weirdly a hard-coded value, it takes a lot more editing than a simple config change.
Code:# Change Proxmox default port sed -i 's|8006|443|g' /usr/share/perl5/PVE/Firewall.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/Cluster/Setup.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/APIServer/AnyEvent.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/API2/LXC.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/API2/Qemu.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/APIClient/LWP.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/CLI/pct.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/CLI/qm.pm sed -i 's|8006|443|g' /usr/share/perl5/PVE/Service/pveproxy.pm echo 'net.ipv4.ip_unprivileged_port_start=0' > /etc/sysctl.d/50-unprivileged-ports.conf reboot
It is actually safer to have these processes which listen to these ports NOT run as root than limit this ports only to applications run as root!Hi,
echo 'net.ipv4.ip_unprivileged_port_start=0' > /etc/sysctl.d/50-unprivileged-ports.conf
This is not a safe setting ....
Good luck / Bafta !
Which is why I've put it into a script to run after any upgrades, so any upgrade that reverts the hard-coded port will be corrected after it is overwritten.That doesn't look like a reliable solution. I would guess a upgrade could revert your changes and might even lock you out from the webUI.