SaferComputing.com

Reference · Self-hosted services

Proxmox VE port 8006: limit the web interface, turn on the firewall, add a second factor for root@pam

Proxmox VE's web interface on port 8006 carries the whole API and listens on every address. Limit it with ALLOW_FROM or LISTEN_IP in /etc/default/pveproxy, turn on the firewall with a management IP set, give root@pam TOTP or WebAuthn and recovery keys, and audit API tokens.

Published
Updated
Last checked
Applies to
Proxmox VE 9.2, as its man pages describe it (documentation version 9.2.13, updated 24 September 2026)
Technical specification
Target artifactThe Proxmox VE web interface and API, served by pveproxy over HTTPS on TCP port 8006, and the SPICE proxy spiceproxy on port 3128; the settings in /etc/default/pveproxy; the Proxmox VE firewall; and root@pam, its second factors and API tokens.
Default behaviourpveproxy and spiceproxy listen on every IPv4 and IPv6 address, and pveproxy's host access policy is allow. The Proxmox VE firewall is off cluster-wide. No account has a second factor until one is added.
Safe statePort 8006 reachable only from your management addresses, through ALLOW_FROM or the firewall's management IP set; the firewall on; TOTP or WebAuthn plus recovery keys on root@pam and every administrator; daily work under a separate administrator; every API token named, privilege-separated and set to expire.
Check on Proxmox VEss -tlnp '( sport = :8006 or sport = :3128 )'
Check on Proxmox VEcat /etc/default/pveproxy, then pve-firewall status
Check on Proxmox VEpveum user tfa list, then pveum user token list root@pam
Check from another devicenc -vz -w 5 SERVER_IP 8006
Fix in /etc/default/pveproxyALLOW_FROM="192.168.1.0/24", DENY_FROM="all" and POLICY="allow", then systemctl restart pveproxy.service spiceproxy.service
Fix with the firewalladd your addresses to the management IP set, then turn the firewall on under Datacenter, Firewall, or with enable: 1 in /etc/pve/firewall/cluster.fw
Fix for root@pamadd TOTP or WebAuthn and a set of recovery keys under Datacenter, Permissions, Two Factor

Read the result

ResultMeaning
*:8006 or [::]:8006The default wildcard address: every IPv4 and IPv6 address on the host
One address, such as 192.168.1.10:8006LISTEN_IP is set: only networks that reach that address can connect
cat finds no fileNo LISTEN_IP, ALLOW_FROM or DENY_FROM: the defaults apply
nc from another network ends in succeeded!That network reaches the port

The commands run in the Proxmox VE shell as root. ALLOW_FROM and DENY_FROM act inside pveproxy, after the connection, so test them in a browser from an address you did not allow: https://SERVER_IP:8006 should not show the sign-in page.

What port 8006 exposes

pveproxy "exposes the whole Proxmox VE API on TCP port 8006 using HTTPS". It runs as www-data with very limited permissions and passes operations that need more to the local pvedaemon. Whoever signs in uses the API with that account's permissions, and root@pam is "an unconfined administrator".

PortUsed by
8006 TCPWeb interface, HTTPS
5900 to 5999 TCPVNC web console, over WebSocket
3128 TCPSPICE proxy
22 TCPSSH, also used for cluster actions
5405 to 5412 UDPCorosync cluster traffic
60000 to 60050 TCPLive migration

The pve-firewall manual also lists rpcbind on UDP port 111 and outgoing mail on port 25.

In a cluster, Proxmox VE opens SSH tunnels between the nodes as root, with the keys in /etc/pve/priv/authorized_keys, for migration, storage replication and console or shell sessions on other nodes, so on a cluster node do not set PermitRootLogin no as SSH password sign-in does: PermitRootLogin prohibit-password refuses root's password and still accepts those keys.

Limit pveproxy in /etc/default/pveproxy

ALLOW_FROM and DENY_FROM

Addresses take any form Net::IP understands: single addresses, ranges such as 10.0.0.1-10.0.0.5, or networks such as 192.168.0.0/22; all means every IPv4 and IPv6 address.

Contents of /etc/default/pveproxy
ALLOW_FROM="192.168.1.0/24"
DENY_FROM="all"
POLICY="allow"
The client matchesPOLICY="allow"POLICY="deny"
ALLOW_FROM onlyAllowedAllowed
DENY_FROM onlyDeniedDenied
BothAllowedDenied
NeitherAllowedDenied

With this file, addresses in 192.168.1.0/24 match both lists and are allowed; every other address matches only DENY_FROM and is denied. Apply it with a reboot or a full restart, which the manual warns can interrupt long-running workers:

Proxmox VE shell, as root
systemctl restart pveproxy.service spiceproxy.service

SSH is not affected, so keep an SSH session open to undo a mistake.

LISTEN_IP

LISTEN_IP sets the address pveproxy and spiceproxy bind to, for example LISTEN_IP="192.0.2.1" in the same file, followed by the same restart. The address must already be configured on the host; for a WireGuard or Tailscale address, see WireGuard and Tailscale binding. The manual does not recommend LISTEN_IP on clustered systems, whose nodes reach each other through pveproxy: use ALLOW_FROM or the firewall there.

Turn on the Proxmox VE firewall

The firewall "is completely disabled by default". Each node's own enable option is already 1, so node rules apply once the cluster-wide option is on. Then "traffic to all hosts will be blocked by default", except traffic from management hosts to port 8006, ports 5900 to 5999, port 3128 and port 22, and corosync traffic in the cluster network. Management hosts are the members of the management IP set, to which Proxmox VE adds the local cluster network.

  1. Open an SSH connection to the host first: "That way you still have access to the host if something goes wrong."
  2. Print the network Proxmox VE treats as local with pve-firewall localnet. For a single host on a public network, the manual says "it is better to explicitly assign the local IP address", as local_network below.
  3. Add each address you manage from to the management IP set, then turn the firewall on under Datacenter, Firewall. The same settings in the file:
Contents of /etc/pve/firewall/cluster.fw
[OPTIONS]
enable: 1

[ALIASES]
local_network 203.0.113.10 # this host's own address

[IPSET management]
198.51.100.25
  1. Check with pve-firewall status, and print the generated rules with pve-firewall compile. The service updates its rules when the files change.

The nftables-based proxmox-firewall is a tech preview that the manual says "is currently not suited for production use"; its node option nftables is 0 by default.

Two-factor sign-in for root@pam

The system's root user "can always log in via the Linux PAM realm", and the account cannot be deleted. Give it, and every other administrator, more than one second factor:

  • TOTP, a time-based one-time password: open the TFA button in the user list, scan the QR code with an authenticator app, type the current code in Verification Code and click Apply. You confirm your password first, unless signed in as root.
  • WebAuthn, sign-in with a security key: it needs "a valid domain with a valid SSL certificate", set under Datacenter, Options, WebAuthn Settings, such as webauthn: rp=mypve.example.com,origin=https://mypve.example.com:8006,id=mypve.example.com in /etc/pve/datacenter.cfg. The manual warns that changing these settings may make every existing WebAuthn registration unusable.
  • Recovery keys: create a set under Datacenter, Permissions, Two Factor. Each key works once, and a user has one set at a time. Keep them where you can reach them without this server.

Eight failed TOTP attempts disable the user's TOTP factors; after 100 failed WebAuthn or recovery key tries, every second factor is blocked for an hour.

Use a separate administrator

The manual describes a group with full administrator rights "without using the root account". Create it and an account in the Proxmox VE authentication server realm, pve:

Proxmox VE shell, as root
pveum group add admin -comment "System Administrators"
pveum acl modify / -group admin -role Administrator
pveum user add alice@pve
pveum passwd alice@pve
pveum user modify alice@pve -group admin

Sign in as alice@pve, add its own second factors, and use it for daily work. Keep root@pam for recovery.

Audit API tokens

A token belongs to a user and is named USER@REALM!TOKENID. Its secret "is only displayed/returned once when the token is generated". With privilege separation, the default, a token gets only the permissions you grant it; without it, the token has every permission of its user, so a root@pam token without separation is as powerful as root. The manual says to disable separation "only when the integration genuinely needs the user's full permissions".

Proxmox VE shell, as root
pveum user list
pveum user token list root@pam
pveum user token remove root@pam TOKENID

Run pveum user token list for each user, and remove each token you cannot name. Give replacements an expiry, in Unix epoch seconds, "so that abandoned automation does not silently keep working", and only the permissions they need:

Proxmox VE shell, as root
pveum user token add alice@pve monitoring -privsep 1 -expire "$(date -d '+90 days' +%s)"
pveum acl modify /vms -token 'alice@pve!monitoring' -role PVEAuditor

Proxmox VE 9.2, released on 21 May 2026, can also regenerate an existing token's secret in place.

Troubleshooting

The web interface stopped answering after a change to /etc/default/pveproxy

Sign in over SSH, correct or remove the lines, then run systemctl restart pveproxy.service spiceproxy.service. An address in LISTEN_IP must exist on the host.

Locked out after turning on the firewall

From an SSH session that is still open, or the server's console, set enable: 0 in /etc/pve/firewall/cluster.fw. pve-firewall stop also removes the rules, and the manual warns that this leaves the host "potentially unprotected".

A second factor is locked

Another administrator can unlock it in the user list, or in the shell with pveum user tfa unlock alice@pve.

Sources