I have an Ubuntu 20.04 server and I installed Monit.
I want to secure the web interface. I followed the following instructions :
https://doc.ubuntu-fr.org/monit
$ cd /var/certs
$ sudo openssl req -new -x509 -days 365 -nodes -config ./monit.cnf -out /var/certs/monit.pem -keyout /var/certs/monit.pem
$ sudo openssl gendh 512 >> /var/certs/monit.pem
$ sudo openssl x509 -subject -dates -fingerprint -noout -in /var/certs/monit.pem
$ sudo chmod 700 /var/certs/monit.pem
1) When I run the following command I got an error. Yet I do it with "sudo". Why is it not working ?
ubuntu@myserver /var/certs $ sudo openssl gendh 512 >> /var/certs/monit.pem
-bash: /var/certs/monit.pem: Permission denied
2) It says in the address bar "not secure", yet I am using HTTPS. Is this normal ?
I would also like to know what these 2 command lines are for :
$ sudo openssl gendh 512 >> /var/certs/monit.pem
$ sudo openssl x509 -subject -dates -fingerprint -noout -in /var/certs/monit.pem