Generate a self signed certificate on Linux
Description:
This article will walk through generating a self signed certificate or certificate signing request (CSR) on a linux server.
Pre-Requisites:
None
Generate the key:
RHEL & CentOS:
openssl genrsa -out "/etc/pki/tls/private/gitlab-registry.key" 4096
Debian & Ubuntu:
openssl genrsa -out "/etc/ssl/private/gitlab-registry.key" 4096
Generate the certificate:
RHEL & CentOS:
openssl req -x509 -sha512 -nodes -newkey rsa:4096 -days 365 -keyout /etc/pki/tls/private/gitlab.key -out /etc/pki/tls/certs/gitlab.crt
Debian & Ubuntu:
openssl req -x509 -sha512 -nodes -newkey rsa:4096 -days 365 -keyout /etc/ssl/private/gitlab.key -out /etc/ssl/certs/gitlab.crt
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:SomeState
Locality Name (eg, city) []:SomeCity
Organization Name (eg, company) [Internet Widgits Pty Ltd]:yourdomain.tld
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:servername.yourdomain.tld
Email Address []:[email protected]
Optionally Generate a CSR:
RHEL & CentOS:
openssl req -new -sha512 -key "/etc/pki/tls/private/gitlab-registry.key" -out "/etc/pki/tls/certs/gitlab-registry.csr"
Debian & Ubuntu:
openssl req -new -sha512 -key "/etc/ssl/private/gitlab-registry.key" -out "/etc/ssl/certs/gitlab-registry.csr"
Post Requisites:
None
Great article
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit