Ubuntu安装Cockpit并改端口

发布于 2020-08-15  679 次阅读


Ubuntu安装Cockpit并改端口

1、安装Cockpit

sudo apt-get install cockpit

2、设置Cockpit

sudo vim /etc/netplan/00-*.yaml

添加renderer: NetworkManager,成为下面这样

network:
  renderer: NetworkManager
  ethernets:
    enp1s0:

应用更改

sudo netplan try 
sudo systemctl enable network-manager.service
sudo systemctl disable systemd-networkd.service

3、修改端口

vim /usr/lib/systemd/system/cockpit.socket
[Socket]
ListenStream=你想要的端口

重启Cockpit,然后使用新的端口访问

sudo systemctl daemon-reload
sudo systemctl restart cockpit.socket
sudo systemctl restart cockpit.service

4、修改连接后显示信息

vim /etc/motd.d/cockpit

修改完成之后保存即可


Satxm,一个正在肝地球Online的人。