Fév
17
|
Sur mon NASW Synology, j’ai OpenSSLW qui est installé…
L’accès n’est pas ouvert en dehors du réseau interne, mais j’ai eu envie d’effectuer quelques tests locaux… alors, je me suis penché sur la génération de certificats…
Afin de pouvoir facilement le refaire ultérieurement en cas de besoin, je mets ci-dessous les différentes lignes de commande que j’ai utilisées…
DiskStation> pwd
/usr/syno/mon_ssl
DiskStation> ls -ll
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
DiskStation>
DiskStation> echo CLIENT
CLIENT
DiskStation> echo Génération de la clé cliente
Génération de la clé cliente
DiskStation>
DiskStation> openssl genrsa -des3 -out client.key 1024
Generating RSA privatebashclient.key:
Verifying - Enter pass phrase for client.key:
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
DiskStation>
DiskStation> echo Génération du certificat client
Génération du certificat client
DiskStation>
DiskStation> openssl req -new -key client.key -out client.csr -config /usr/syno/mon_ssl/openssl.cnf
Enter pass phrase for client.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [FR]:
State or Province Name (full name) [NA]:
Locality Name (eg, city) [Clichy]:
Organization Name (eg, company) [Whiler.com]:
Organizational Unit Name (eg, section) [Home]:
Common Name (eg, YOUR name) []:Mon client
Email Address [no_spam@whiler.com]:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:To remember
An optional company name [Whiler.com]:
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 765 Feb 17 13:04 client.csr
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
DiskStation>
DiskStation> echo Signer le certificat client
Signer le certificat client
DiskStation>
DiskStation> openssl x509 -req -days 3650 -in client.csr -signkey client.key -out client.crt
Signature ok
subject=/C=FR/ST=NA/L=Clichy/O=Whiler.com/OU=Home/CN=Mon client/emailAddress=no_spam@whiler.com
Getting Private key
Enter pass phrase for client.key:
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 928 Feb 17 13:05 client.crt
-rw-r--r-- 1 root root 765 Feb 17 13:04 client.csr
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
DiskStation>
DiskStation> echo CLIENT terminé
CLIENT terminé
DiskStation> echo SERVEUR
SERVEUR
DiskStation> echo Génération de la clé serveur
Génération de la clé serveur
DiskStation>
DiskStation> openssl genrsa -des3 -out serveur.key 1024
Generating RSA private key, 1024 bit long modulus
............................++++++
.................++++++
e is 65537 (0x10001)
Enter pass phrase for serveur.key:
Verifying - Enter pass phrase for serveur.key:
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 928 Feb 17 13:05 client.crt
-rw-r--r-- 1 root root 765 Feb 17 13:04 client.csr
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
-rw-r--r-- 1 root root 951 Feb 17 13:07 serveur.key
DiskStation>
DiskStation> echo Génération du certificat serveur
Génération du certificat serveur
DiskStation>
DiskStation> openssl req -new -key serveur.key -out serveur.csr -config /usr/syno/mon_ssl/openssl.cnf
Enter pass phrase for serveur.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [FR]:
State or Province Name (full name) [NA]:
Locality Name (eg, city) [Clichy]:
Organization Name (eg, company) [Whiler.com]:
Organizational Unit Name (eg, section) [Home]:
Common Name (eg, YOUR name) []:Mon serveur
Email Address [no_spam@whiler.com]:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:2 remember
An optional company name [Whiler.com]:
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 928 Feb 17 13:05 client.crt
-rw-r--r-- 1 root root 765 Feb 17 13:04 client.csr
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
-rw-r--r-- 1 root root 765 Feb 17 13:08 serveur.csr
-rw-r--r-- 1 root root 951 Feb 17 13:07 serveur.key
DiskStation>
DiskStation> echo Signer le certificat serveur
Signer le certificat serveur
DiskStation>
DiskStation> openssl x509 -req -days 3650 -in serveur.csr -CA client.crt -CAkey client.key -set_serial 01 -out serveur.crt
Signature ok
subject=/C=FR/ST=NA/L=Clichy/O=Whiler.com/OU=Home/CN=Mon serveur/emailAddress=no_spam@whiler.com
Getting CA Private Key
Enter pass phrase for client.key:
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 928 Feb 17 13:05 client.crt
-rw-r--r-- 1 root root 765 Feb 17 13:04 client.csr
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
-rw-r--r-- 1 root root 916 Feb 17 13:09 serveur.crt
-rw-r--r-- 1 root root 765 Feb 17 13:08 serveur.csr
-rw-r--r-- 1 root root 951 Feb 17 13:07 serveur.key
DiskStation>
DiskStation> echo SERVEUR terminé
SERVEUR terminé
DiskStation>
DiskStation> echo Création d\'une clé non sécurisée pour Apache
Création d’une clé non sécurisée pour Apache
DiskStation>
DiskStation> openssl rsa -in serveur.key -out serveur.key.not_secure
Enter pass phrase for serveur.key:
writing RSA key
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 928 Feb 17 13:05 client.crt
-rw-r--r-- 1 root root 765 Feb 17 13:04 client.csr
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
-rw-r--r-- 1 root root 916 Feb 17 13:09 serveur.crt
-rw-r--r-- 1 root root 765 Feb 17 13:08 serveur.csr
-rw-r--r-- 1 root root 951 Feb 17 13:07 serveur.key
-rw-r--r-- 1 root root 887 Feb 17 13:11 serveur.key.not_secure
DiskStation>
DiskStation> echo FIN : Il ne reste plus qu\'à s\'en servir !
FIN : Il ne reste plus qu’à s’en servir !
DiskStation>
/usr/syno/mon_ssl
DiskStation> ls -ll
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
DiskStation>
DiskStation> echo CLIENT
CLIENT
DiskStation> echo Génération de la clé cliente
Génération de la clé cliente
DiskStation>
DiskStation> openssl genrsa -des3 -out client.key 1024
Generating RSA privatebashclient.key:
Verifying - Enter pass phrase for client.key:
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
DiskStation>
DiskStation> echo Génération du certificat client
Génération du certificat client
DiskStation>
DiskStation> openssl req -new -key client.key -out client.csr -config /usr/syno/mon_ssl/openssl.cnf
Enter pass phrase for client.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [FR]:
State or Province Name (full name) [NA]:
Locality Name (eg, city) [Clichy]:
Organization Name (eg, company) [Whiler.com]:
Organizational Unit Name (eg, section) [Home]:
Common Name (eg, YOUR name) []:Mon client
Email Address [no_spam@whiler.com]:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:To remember
An optional company name [Whiler.com]:
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 765 Feb 17 13:04 client.csr
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
DiskStation>
DiskStation> echo Signer le certificat client
Signer le certificat client
DiskStation>
DiskStation> openssl x509 -req -days 3650 -in client.csr -signkey client.key -out client.crt
Signature ok
subject=/C=FR/ST=NA/L=Clichy/O=Whiler.com/OU=Home/CN=Mon client/emailAddress=no_spam@whiler.com
Getting Private key
Enter pass phrase for client.key:
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 928 Feb 17 13:05 client.crt
-rw-r--r-- 1 root root 765 Feb 17 13:04 client.csr
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
DiskStation>
DiskStation> echo CLIENT terminé
CLIENT terminé
DiskStation> echo SERVEUR
SERVEUR
DiskStation> echo Génération de la clé serveur
Génération de la clé serveur
DiskStation>
DiskStation> openssl genrsa -des3 -out serveur.key 1024
Generating RSA private key, 1024 bit long modulus
............................++++++
.................++++++
e is 65537 (0x10001)
Enter pass phrase for serveur.key:
Verifying - Enter pass phrase for serveur.key:
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 928 Feb 17 13:05 client.crt
-rw-r--r-- 1 root root 765 Feb 17 13:04 client.csr
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
-rw-r--r-- 1 root root 951 Feb 17 13:07 serveur.key
DiskStation>
DiskStation> echo Génération du certificat serveur
Génération du certificat serveur
DiskStation>
DiskStation> openssl req -new -key serveur.key -out serveur.csr -config /usr/syno/mon_ssl/openssl.cnf
Enter pass phrase for serveur.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [FR]:
State or Province Name (full name) [NA]:
Locality Name (eg, city) [Clichy]:
Organization Name (eg, company) [Whiler.com]:
Organizational Unit Name (eg, section) [Home]:
Common Name (eg, YOUR name) []:Mon serveur
Email Address [no_spam@whiler.com]:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:2 remember
An optional company name [Whiler.com]:
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 928 Feb 17 13:05 client.crt
-rw-r--r-- 1 root root 765 Feb 17 13:04 client.csr
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
-rw-r--r-- 1 root root 765 Feb 17 13:08 serveur.csr
-rw-r--r-- 1 root root 951 Feb 17 13:07 serveur.key
DiskStation>
DiskStation> echo Signer le certificat serveur
Signer le certificat serveur
DiskStation>
DiskStation> openssl x509 -req -days 3650 -in serveur.csr -CA client.crt -CAkey client.key -set_serial 01 -out serveur.crt
Signature ok
subject=/C=FR/ST=NA/L=Clichy/O=Whiler.com/OU=Home/CN=Mon serveur/emailAddress=no_spam@whiler.com
Getting CA Private Key
Enter pass phrase for client.key:
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 928 Feb 17 13:05 client.crt
-rw-r--r-- 1 root root 765 Feb 17 13:04 client.csr
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
-rw-r--r-- 1 root root 916 Feb 17 13:09 serveur.crt
-rw-r--r-- 1 root root 765 Feb 17 13:08 serveur.csr
-rw-r--r-- 1 root root 951 Feb 17 13:07 serveur.key
DiskStation>
DiskStation> echo SERVEUR terminé
SERVEUR terminé
DiskStation>
DiskStation> echo Création d\'une clé non sécurisée pour Apache
Création d’une clé non sécurisée pour Apache
DiskStation>
DiskStation> openssl rsa -in serveur.key -out serveur.key.not_secure
Enter pass phrase for serveur.key:
writing RSA key
DiskStation>
DiskStation> ls -ll
-rw-r--r-- 1 root root 928 Feb 17 13:05 client.crt
-rw-r--r-- 1 root root 765 Feb 17 13:04 client.csr
-rw-r--r-- 1 root root 963 Feb 17 13:03 client.key
-rwxr-xr-x 1 root root 9491 Feb 17 12:46 openssl.cnf
-rw-r--r-- 1 root root 916 Feb 17 13:09 serveur.crt
-rw-r--r-- 1 root root 765 Feb 17 13:08 serveur.csr
-rw-r--r-- 1 root root 951 Feb 17 13:07 serveur.key
-rw-r--r-- 1 root root 887 Feb 17 13:11 serveur.key.not_secure
DiskStation>
DiskStation> echo FIN : Il ne reste plus qu\'à s\'en servir !
FIN : Il ne reste plus qu’à s’en servir !
DiskStation>
Cette page m’a bien aidé à comprendre et trouver les lignes nécessaires ; merci à son auteur !
hello whiler

N’hésite pas à ouvrir ton NAS si tu as de bons films
tu ne craint plus rien avec de bons certifaicats ssl
@ philgoodgood : Salut,
J’n’ai aucun film sur mon NAS… tu m’as pris pour megaupload ou quoi ?

J’ai mes photos, mes sauvegardes, … bref, beaucoup de données persos… ça évite de les sauvegarder sur des clouds qui peuvent être fermés du jour au lendemain par le FBI…
recoucou

bon dimanche à tous
@ philgoodgood : +1
modifié/traduit par Whiler
Politique de confidentialité