0

我试图在我的 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

任何帮助将不胜感激谢谢

4

1 回答 1

0

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

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

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

于 2013-05-09T04:31:24.147 回答