Not so long ago, when @Wellington_Rodrigues asked the same, there was a CLI option on e-smith db prop…
…but was recently removed:
I’ve tried with the following commands and it worked, but just in case try it before on a test machine:
#
# Change cockpit port
#
# replace 9000 with the desired port number
# (make sure to choose an unused port)
#
mkdir -p /etc/e-smith/templates-custom/etc/shorewall/stoppedrules/
cp /etc/e-smith/templates{,-custom}/etc/shorewall/stoppedrules/30cockpit
mkdir -p /etc/e-smith/templates-custom/etc/shorewall/rules/
cp /etc/e-smith/templates{,-custom}/etc/shorewall/rules/60cockpit
sed -i s/9090/9000/g /etc/e-smith/templates-custom/etc/shorewall/stoppedrules/30cockpit /etc/e-smith/templates-custom/etc/shorewall/rules/60cockpit
expand-template /etc/shorewall/stoppedrules /etc/shorewall/rules
# here it is done manually, but the systemd unit override could have been created using `systemctl edit cockpit.socket`
mkdir -p /etc/systemd/system/cockpit.socket.d/
cat > /etc/systemd/system/cockpit.socket.d/listen.conf <<EOF
[Socket]
ListenStream=
ListenStream=9000
EOF
systemctl daemon-reload
signal-event firewall-adjust
systemctl restart cockpit.socket
Don’t think it will change frequently, but do note that if a new update changes the default templates we shall remember to reflect the changes on the templates-custom.