Cockpit图像化服务管理工具安装

CentOS:

sudo yum install -y cockpit cockpit-docker cockpit-machines cockpit-dashboard cockpit-storaged cockpit-packagekit

sudo systemctl enable --now cockpit.socket
sudo firewall-cmd --permanent --zone=public --add-service=cockpit
sudo firewall-cmd --reload

Ubuntu:

echo 'deb http://deb.debian.org/debian stretch-backports main' | sudo tee /etc/apt/sources.list.d/backports.list

sudo apt-get update
sudo apt-get install cockpit cockpit-docker cockpit-machines cockpit-dashboard cockpit-storaged cockpit-packagekit

sudo systemctl enable --now cockpit.socket
sudo firewall-cmd --permanent --zone=public --add-service=cockpit
sudo firewall-cmd --reload

更改服务端口:

vim /usr/lib/systemd/system/cockpit.socket
---
[Unit]
Description=Cockpit Web Service Socket
Documentation=man:cockpit-ws(8)
Wants=cockpit-motd.service

[Socket]
ListenStream=8080
ExecStartPost=-/usr/share/cockpit/motd/update-motd '' localhost
ExecStartPost=-/bin/ln -snf active.motd /run/cockpit/motd
ExecStopPost=-/bin/ln -snf /usr/share/cockpit/motd/inactive.motd /run/cockpit/motd

[Install]
WantedBy=sockets.target
---

# 允许新端口通过防火墙
sudo firewall-cmd --add-port=8080/tcp 
sudo firewall-cmd --permanent --add-port=8080/tcp
posted @ 2023-06-12 15:48  wanghongwei-dev  阅读(225)  评论(0编辑  收藏  举报