【问题标题】:openvpn easy-rsa command not found [closed]找不到openvpn easy-rsa命令[关闭]
【发布时间】:2013-05-09 12:31:24
【问题描述】:

我试图在我的 centos 6 机器上安装 openvpn 我正在使用 epel 存储库安装 vpn 安装时一切顺利,但不知何故要生成证书部分 输入“source ./vars”命令时找不到很多命令

这里是终端返回的

[root@... easy-rsa]# source ./vars
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
NOTE: If you run ./clean-all, I will be doing a rm -rf on /etc/openvpn/easy-rsa/keys
: command not found
: command not found
: command not found
: command not found
: command not found

这是我的 vars 文件设置

# easy-rsa parameter settings

# NOTE: If you installed from an RPM,
# don't edit this file in place in
# /usr/share/openvpn/easy-rsa --
# instead, you should copy the whole
# easy-rsa directory to another location
# (such as /etc/openvpn) so that your
# edits will not be wiped out by a future
# OpenVPN package upgrade.

# This variable should point to
# the top level of the easy-rsa
# tree.
export EASY_RSA="`pwd`"

#
# This variable should point to
# the requested executables
#
export OPENSSL="openssl"
export PKCS11TOOL="pkcs11-tool"
export GREP="grep"


# This variable should point to
# the openssl.cnf file included
# with easy-rsa.
export KEY_CONFIG=/etc/openvpn/easy-rsa/openssl.cnf

# Edit this variable to point to
# your soon-to-be-created key
# directory.
#
# WARNING: clean-all will do
# a rm -rf on this directory
# so make sure you define
# it correctly!
export KEY_DIR="$EASY_RSA/keys"

# Issue rm -rf warning
echo NOTE: If you run ./clean-all, I will be doing a rm -rf on $KEY_DIR

# PKCS11 fixes
export PKCS11_MODULE_PATH="dummy"
export PKCS11_PIN="dummy"

# Increase this to 2048 if you
# are paranoid.  This will slow
# down TLS negotiation performance
# as well as the one-time DH parms
# generation process.
export KEY_SIZE=1024

# In how many days should the root CA key expire?
export CA_EXPIRE=3650

# In how many days should certificates expire?
export KEY_EXPIRE=3650

# These are the default values for fields
# which will be placed in the certificate.
# Don't leave any of these fields blank.
export KEY_COUNTRY="US"
export KEY_PROVINCE="CA"
export KEY_CITY="SanFrancisco"
export KEY_ORG="Fort-Funston"
export KEY_EMAIL="me@myhost.mydomain"
export KEY_EMAIL=mail@host.domain
export KEY_CN=changeme
export KEY_NAME=changeme
export KEY_OU=changeme
export PKCS11_MODULE_PATH=changeme
export PKCS11_PIN=1234

任何帮助将不胜感激 谢谢

【问题讨论】:

    标签: rsa openvpn centos6


    【解决方案1】:

    如果您注意到在 echo 之前有 7 个 command not found 语句。回声之前还有 7 条“空”行。似乎关键 dir 变量在 echo 语句中正确扩展。在 echo 语句之后有 5 个“空”行和另外 5 个 command not found 错误。这让我觉得 command not found 语句是“空”行的结果。

    显然,如果该行为空,则不应导致此类错误。 “vars”文件是如何到达那里的?您是否复制/粘贴它并且在此过程中复制了不可见的字符?或者它是在使用不同类型回车的设备上编辑的?

    您应该使用 vim 之类的编辑器来帮助您查看通常隐藏的字符。您也可以尝试使用 tofrodos 之类的程序来转换回车符。当您获取文件时,您实际上是在执行脚本,并且导出的任何变量都将成为我们获取该文件的 shell 的一部分。通常脚本将符合 unix 行尾。

    【讨论】:

    • 它是用这个命令复制的 cp -rf /usr/share/openvpn/easy-rsa/2.0/* /etc/openvpn/easy-rsa 我试着删除空行现在它的工作:) 谢谢指出来
    猜你喜欢
    • 2022-11-28
    • 2014-09-10
    • 2014-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-11
    • 2011-05-20
    相关资源
    最近更新 更多