メインメニューを開く

差分

OpenVPNのインストール

1,188 バイト追加, 2019年12月26日 (木) 14:58
$ scp /tmp/*.req foo@hostname-of-CA:/tmp}}
== 認証局サーバー = 公開鍵に署名する(認証局サーバー) ===VPNサーバー&クライアントのreqファイルに認証局の証明書で署名していきます。<syntaxhighlight lang="bash"br/># cd /etc/easy-rsa# easyrsa import-req /tmp/servername.req servernameUsing SSL: openssl OpenSSL 1.1.1d 10 Sep 2019(…上の文言、間違ってるかも…)
The request has been successfully imported with a short name of: servernameまずは以下のコマンドでディレクトリを移動します。You may now use this name to perform signing operations on this request.{{bc|# cd /etc/easy-rsa}}
==== VPNサーバー用の公開鍵に署名 ====以下のコマンドを実行して、reqファイルをインポートします。{{hc|# easyrsa import-req /tmp/client1server.req client1server|Using SSL: openssl OpenSSL 1.1.1d 10 Sep 2019
The request has been successfully imported with a short name of: client1serverYou may now use this name to perform signing operations on this request.}}
次に署名済みの公開鍵を取り出します。<pre style="margin-bottom: 0; border-bottom:none; padding-bottom:0.8em;"># easyrsa sign-req server servernameserver</pre><pre style="margin-top: 0; border-top-style:dashed; padding-top: 0.8em;">Using SSL: openssl OpenSSL 1.1.1d 10 Sep 2019
subject=
commonName = xxxxxxxx[鍵ペアを生成したときに設定した名前が表示されます]
Data Base Updated
Certificate created at: /etc/easy-rsa/pki/issued/servernameserver.crt</pre>
==== VPNクライアント用の公開鍵に署名 ====VPNサーバーと同様にクライアント用の公開鍵に署名していきます。{{hc|# easyrsa import-req /tmp/client.req client|Using SSL: openssl OpenSSL 1.1.1d 10 Sep 2019 The request has been successfully imported with a short name of: clientYou may now use this name to perform signing operations on this request.}} <pre style="margin-bottom: 0; border-bottom:none; padding-bottom:0.8em;"># easyrsa sign-req client client1client</pre><pre style="margin-top: 0; border-top-style:dashed; padding-top: 0.8em;">Using SSL: openssl OpenSSL 1.1.1d 10 Sep 2019
subject=
commonName = yyyyyyyy[鍵ペアを生成したときに設定した名前が表示されます]
Data Base Updated
Certificate created at: /etc/easy-rsa/pki/issued/client1client.crt</syntaxhighlightpre>
認証局からVPNサーバーとクライアントに返却認証局から署名済みの公開鍵をVPNサーバーに返却します。<br/>まぁ適当に移してください。<syntaxhighlight lang="bash"br/>クライアント用も同様にVPNサーバーに移します。<br/>後で、クライアント用の設定ファイルを作成するので…{{bc|# cp /etc/easy-rsa/pki/issued/*.crt /tmp
# chown foo /tmp/*.crt
$ scp /tmp/*.crt foo@hostname-of-openvpn_server:/tmp</syntaxhighlight>}}
== VPNサーバー ==