メインメニューを開く

差分

OpenVPNのインストール

608 バイト追加, 2019年12月26日 (木) 13:50
=== 認証局の設立(認証局サーバー) ===
認証局にするサーバーに以下のコマンドを実行して「easy認証局にするサーバーに以下のコマンドを実行して「Easy-rsa」をインストールします。RSA」をインストールします。<syntaxhighlight lang="bash">{{bc|# pacman -S easy-rsa</syntaxhighlight>}}
<syntaxhighlight lang="bash">インストールしたら「easy-rsa」に移動しておきます。{{bc|# cd /etc/easy-rsaeasyrsa init-pki}}
認証局の構築をしていきます。<br/>以下のコマンドで認証局の初期化を行います。{{hc|# easyrsa init-pki|init-pki complete; you may now create a CA or requests.Your newly created PKI dir is: /etc/easy-rsa/pki}}
完了したら、認証局の鍵ペアを生成します。<pre style="margin-bottom: 0; border-bottom:none; padding-bottom:0.8em;"># easyrsa build-ca</pre><pre style="margin-top: 0; border-top-style:dashed; padding-top: 0.8em;">Using SSL: openssl OpenSSL opensslOpenSSL 1.1.1d 10 Sep 2019 Enter New CA Key Passphrase: [任意のパスフレーズを入力]Re-Enter New CA Key Passphrase: [任意のパスフレーズを入力]
Generating RSA private key, 2048 bit long modulus (2 primes)
...........................+++++
If you enter '.', the field will be left blank.
-----
Common Name (eg: your user, host, or server name) [Easy-RSA CA]:xxxxxxxx[任意の名前を入力] 
CA creation complete and you may now import and sign cert requests.
Your new CA certificate file for publishing is at:
/etc/easy-rsa/pki/ca.crt</syntaxhighlightpre>
CAの公開鍵をVPNサーバーに移行作成された認証局の証明書をVPNサーバーに移します。<br/>証明書なのでまぁ適当に移せば良いかと思います。<syntaxhighlight lang="bash"br/>下の例ではSCPを使用していますが…私はSFTPを使用しました。{{bc|# cp /etc/easy-rsa/pki/ca.crt /tmp# chown foo /tmp/ca.crt$ scp /tmp/ca.crt foo@hostname-of-openvpn-server:/tmp</syntaxhighlight>}}
== VPNサーバー ==