openEuler Linux服务器Web管理神器-cockpit

62 篇文章 3 订阅
13 篇文章 0 订阅
文章介绍了在openEuler操作系统上安装和配置cockpit工具的步骤,包括通过yum安装,启动和设置开机启动服务,开放9090端口以允许通过防火墙进行远程访问,以及如何在浏览器中访问cockpitWeb界面进行服务器管理。
摘要由CSDN通过智能技术生成

openEuler Linux服务器Web管理神器-cockpit

操作系统:openEuler
设置 cockpit 自启动可能会遇到报错,文末提供解决方案

# 在线安装cockpit
yum -y install cockpit
# 启动cockpit服务
systemctl start cockpit
# 开机自启动cockpit服务
systemctl enable cockpit
# 设置防火墙端口放行规则
firewall-cmd --zone=public --add-port=9090/tcp --permanent
# 重新加载防火墙规则
firewall-cmd --reload

浏览器访问
https://ip:9090/
cockpit
cockpit
cockpit
cockpit
cockpit
cockpit
cockpit
cockpit
cockpit
cockpit
cockpit
cockpit
cockpit
cockpit
cockpit
cockpit
cockpit

设置cockpit自启动

设置 cockpit 自启动 遇到如下报错:

The unit files have no installation config (WantedBy=, RequiredBy=, UpheldBy=,
Also=, or Alias= settings in the [Install] section, and DefaultInstance= for
template units). This means they are not meant to be enabled or disabled using systemctl.
 
Possible reasons for having these kinds of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/, .requires/, or .upholds/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.

设置cockpit自启动

根据提示服务的unit文件中’[Install]‘单元部分找不到’WantedBy=, RequiredBy=, Also=, Alias=‘的相关设置,
所以不能使用systemctl来配置自启动,
修改文件 /usr/lib/systemd/system/cockpit.service
末尾添加内容如下:

[Install]
WantedBy=multi-user.target

完整内容如下:

[Unit]
Description=Cockpit Web Service
Documentation=man:cockpit-ws(8)
Requires=cockpit.socket
Requires=cockpit-wsinstance-http.socket cockpit-wsinstance-https-factory.socket
After=cockpit-wsinstance-http.socket cockpit-wsinstance-https-factory.socket

[Service]
RuntimeDirectory=cockpit/tls
# systemd ≥ 241 sets this automatically
Environment=RUNTIME_DIRECTORY=/run/cockpit/tls
ExecStartPre=+/usr/libexec/cockpit-certificate-ensure --for-cockpit-tls
ExecStart=/usr/libexec/cockpit-tls
User=cockpit-ws
Group=cockpit-ws
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
ProtectKernelTunables=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
MemoryDenyWriteExecute=true
[Install]
WantedBy=multi-user.target

修改 /usr/lib/systemd/system/cockpit.service 文件后,设置cockpit自启动

systemctl enable cockpit

设置cockpit自启动

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

李昊哲小课

桃李不言下自成蹊

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值