What is Cockpit?
Cockpit is an interactive server admin interface. It is easy to use and very lightweight. Cockpit interacts directly with the operating system from a real Linux session in a browser. -https://github.com/cockpit-project/cockpit
Prerequisites
- A XCA PKI database https://youtu.be/ezzj3x207lQ
Create Your SSL Certificate
- Launch XCA
- Open the PKI database if it is not already (File > Open DataBase), enter password
- Click on the Certificates tab, right click on your Intermediate CA certificate
- Select New
- On the Source tab, make sure Use this Certificate for signing is selected
- Verify your Intermediate CA certificate is selected from the drop down
- Click the Subject tab
- Complete the Distinguished Name section
internalName: debian.i12bretro.local
countryName: US
stateOrProvinceName: Virginia
localityName: Northern
organizationName: i12bretro
organizationUnitName: i12bretro Certificate Authority
commonName: debian.i12bretro.local - Click the Generate a New Key button
- Enter a name and set the key size to at least 2048
- Click Create
- Click on the Extensions tab
- Select End Entity from the type list
- Click Edit next to Subject Alternative Name
- Add any DNS or IP addresses that the certificate will identify
- Update the validity dates to fit your needs
- Click the Key Usage tab
- Under Key Usage select Digital Signature, Key Encipherment
- Under Extended Key Usage select Web Server and Web Client Authentication
- Click the Netscape tab
- Select SSL Server
- Click OK to create the certificate
Exporting Required Files
- In XCA, click on the Certificates tab
- Right click the SSL certificate > Export > File
- Set the file name with a .crt extension and verify the export format is PEM (*.crt)
- Click OK
- Click the Private Keys tab
- Right click the private key generated for the SSL certificate > Export > File
- Set the file name with a .key extension and verify the export format is PKCS #8 (*.pk8)
- Click OK
Applying the Certificates to Cockpit
Per the Cockpit documentation, Cockpit will "use the last file with a .cert or .crt extension in alphabetical order" and the private key "must be contained in a separate file with the same name as the certificate, but with a .key suffix"
- Download WinSCP Download
- Extract WinSCP and run the executable
- Connect to the Cockpit host IP address via WinSCP
- Copy the exported .crt and .key files to the target host home/$USER/Documents directory
- Connect to the target host via SSH or console and run the following commands
# copy the .crt file
sudo cp ~/Documents/*.crt /etc/cockpit/ws-certs.d/
# copy the .key file
sudo cp ~/Documents/*.key /etc/cockpit/ws-certs.d/
# restart cockpit service
sudo systemctl restart cockpit - Open a web browser and navigate to the Cockpit web UI https://DNS:9090
- The Cockpit web UI should be utilizing the new SSL certificate