在命令中输入输入?

我正在通过需要创建OpenVPN帐户的程序运行命令。 在输入此行后开始创建帐户:

cd /etc/openvpn/easy-rsa; . ./vars; ./build-key username 

我需要让它没有输入10次[比如按下输入],然后按两次y。 它需要全部都在这一行。 这可能吗? 提前致谢。

编辑:

 root@suffice-vpn:~# cd /etc/openvpn/easy-rsa; . ./vars; <<<$'\n\n\n\n\n\n\n\n\n\nyy' ./build-key username NOTE: If you run ./clean-all, I will be doing a rm -rf on /etc/openvpn/easy-rsa/keys Generating a 2048 bit RSA private key ..............+++ .....................+++ writing new private key to 'username.key' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [US]:State or Province Name (full name) [NY]:Locality Name (eg, city) [Merrick]:Organization Name (eg, company) [IceWare]:Organizational Unit Name (eg, section) [IceWare]:Common Name (eg, your name or your server's hostname) [username]:Name [server]:Email Address [iceware@programmer.net]: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:An optional company name []:Using configuration from /etc/openvpn/easy-rsa/openssl-1.0.0.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows countryName :PRINTABLE:'US' stateOrProvinceName :PRINTABLE:'NY' localityName :PRINTABLE:'Merrick' organizationName :PRINTABLE:'IceWare' organizationalUnitName:PRINTABLE:'IceWare' commonName :PRINTABLE:'username' name :PRINTABLE:'server' emailAddress :IA5STRING:'iceware@programmer.net' Certificate is to be certified until Jan 14 16:59:03 2026 GMT (3650 days) Sign the certificate? [y/n]:CERTIFICATE WILL NOT BE CERTIFIED: I/O error root@suffice-vpn:/etc/openvpn/easy-rsa# 

正如你所看到的,它完成了填充空白的过程[保留我希望保持相同的所有信息],但后来我得到了这个I / O错误。

我使用这个命令解决了它:

 cd /etc/openvpn/easy-rsa; . ./vars; ./build-key --batch username