当我想运行源./vars和./clean-all时,无法创建证书

时间:2014-12-01 03:27:57

标签: ubuntu-14.04 openvpn

我找到了类似的帖子,但它仍然没有解决我的问题。(OpenVPN Source vars not working on debian

我正在建立OpenVPN https://help.ubuntu.com/14.04/serverguide/openvpn.html

当我尝试根据以下指南创建证书时出现问题:

cd /etc/openvpn/easy-rsa/ ## move to the easy-rsa directory
sudo chown -R root:admin . ## make this directory writable by the system administrators
source ./vars ## execute your new vars file
./clean-all ## Setup the easy-rsa directory (Deletes all keys)
./build-dh ## takes a while consider backgrounding
./pkitool --initca ## creates ca cert and key
./pkitool --server server ## creates a server cert and key
cd keys
openvpn --genkey --secret ta.key ## Build a TLS key
cp server.crt server.key ca.crt dh1024.pem ta.key ../../

当我尝试:

source ./vars
shell给了我回复:

NOTE: If you run ./clean-all, I will be doing a rm -r on /etc/openvpv/easy-rsa/keys

我忽略了它并尝试了下一行:

sudo ./clean-all
然后它说:

Please source the vars script first (i.e. "source ./vars")
Make sure you have edited it to reflect your configuration

我在google和stackoverflow中搜索,未能解决问题。

感谢您的帮助

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:9)

  1. 重启电脑
  2. 打开终端并输入sudo su以root身份登录
  3. 转到easy-rsa目录(在我的文件中,文件在easy-rsa / 2.0 /中)
  4. 键入mkdir keys
  5. 类型来源./vars
  6. 键入./clean-all
  7. 输入./build-ca

    所有与之前相同的命令,但创建了密钥 目录并实际以root身份登录,而不是运行 它与sudo似乎做了伎俩

  8. 从这里采取:http://ubuntuforums.org/showthread.php?t=801135