ubuntu 22.04系统中安装cockpit web图形服务器管理工具

2023-06-01 00:00:00 安装 图形 管理工具

Cockpit 是一种开源免费的基于 Web 的图形服务器管理工具,可让管理员和 Linux 用户从浏览器轻松管理和配置其 Linux 服务器 / PC。

它针对 Linux 新手用户或想要在图形界面上管理服务器的人,而无需在命令行上工作。

Cockpit 易于安装,使用简单,它允许您执行以下任务。

密切关注系统指标和性能
创建和管理用户
浏览和搜索系统日志
检查基于系统的服务并与之交互
进入终端并执行命令
检查系统硬件
创建和管理虚拟机
升级软件包到最新版本
配置防火墙等等


进入安装步骤:

[email protected]:~# apt install cockpit
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libfwupdplugin1 libxmlb1
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  cockpit-bridge cockpit-dashboard cockpit-networkmanager cockpit-packagekit cockpit-storaged cockpit-system cockpit-ws cracklib-runtime libblockdev-mdraid2 libbluetooth3 libbytesize1 libcrack2
  libjansson4 libndp0 libnl-route-3-200 libnm0 libpcsclite1 libpwquality-common libpwquality-tools libpwquality1 libteamdctl0 network-manager network-manager-pptp ppp pptp-linux wamerican
  wpasupplicant
Suggested packages:
  cockpit-doc cockpit-pcp cockpit-machines xdg-utils sssd-dbus pcscd avahi-autoipd libteam-utils wpagui libengine-pkcs11-openssl
The following NEW packages will be installed:
  cockpit cockpit-bridge cockpit-dashboard cockpit-networkmanager cockpit-packagekit cockpit-storaged cockpit-system cockpit-ws cracklib-runtime libblockdev-mdraid2 libbluetooth3 libbytesize1
  libcrack2 libjansson4 libndp0 libnl-route-3-200 libnm0 libpcsclite1 libpwquality-common libpwquality-tools libpwquality1 libteamdctl0 network-manager network-manager-pptp ppp pptp-linux wamerican
  wpasupplicant
0 upgraded, 28 newly installed, 0 to remove and 9 not upgraded.
Need to get 9,816 kB of archives.
After this operation, 24.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal/universe amd64 cockpit-bridge amd64 215-1 [557 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal/universe amd64 cockpit-ws amd64 215-1 [1,298 kB]
...                                                                                                  
Fetched 9,816 kB in 11s (892 kB/s)   
...                                                                                                                                          
Preconfiguring packages ...
...


设置开机启动

[email protected]:~# systemctl enable --now cockpit.socket

查看是否安装成功

[email protected]:~# apt -qq list cockpit
cockpit/focal,now 215-1 all [installed]

启动cockpit

[email protected]:~# systemctl start cockpit

查看cockpit运行状态

[email protected]:~# systemctl status cockpit
● cockpit.service - Cockpit Web Service
     Loaded: loaded (/lib/systemd/system/cockpit.service; static; vendor preset: enabled)
     Active: active (running) since Tue 2023-02-14 07:19:05 UTC; 54s ago
TriggeredBy: ● cockpit.socket
       Docs: man:cockpit-ws(8)
    Process: 80310 ExecStartPre=/usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type= (code=exited, status=0/SUCCESS)
   Main PID: 80320 (cockpit-tls)
      Tasks: 1 (limit: 2261)
     Memory: 1.8M
     CGroup: /system.slice/cockpit.service
             └─80320 /usr/lib/cockpit/cockpit-tls
Feb 14 07:19:04 htz systemd[1]: Starting Cockpit Web Service...
Feb 14 07:19:04 htz remotectl[80310]: Generating temporary certificate using: sscg --quiet --lifetime 3650 --key-strength 2048 --cert-key-file /etc/cockpit/ws-certs.d/0-self-signed.cert --cert-file >
Feb 14 07:19:04 htz remotectl[80310]: Error generating temporary dummy cert using sscg, falling back to openssl
Feb 14 07:19:04 htz remotectl[80310]: Generating temporary certificate using: openssl req -x509 -days 36500 -newkey rsa:2048 -keyout /etc/cockpit/ws-certs.d/0-self-signed.VU1XZ1.tmp -keyform PEM -no>
Feb 14 07:19:05 htz systemd[1]: Started Cockpit Web Service.

查看运行进程及监听端口

[email protected]:~# ss -tunlpe | grep cockpit
tcp     LISTEN   0        4096                   *:9090                *:*       users:(("cockpit-tls",pid=80367,fd=3),("systemd",pid=1,fd=129)) ino:118981 sk:4 v6only:0 <->


直接访问一下Cockpit Web 控制台吧

https://172.18.1.212:9090

截两张

Cockpit Web.png

2.png

相关文章