OpenVPN-Windows의 Auth-USER-PASS 파일 옵션 [폐쇄
-
05-07-2019 - |
문제
--auth-user-pass switch를 통해 파일에서 사용자 이름/비밀번호를 OpenVPN으로 전달하려고하면 다음 오류가 발생합니다.
"Sorry, 'Auth' password cannot be read from a file."
적어도 그들은 공손합니다.
따라서 우리의 해결 방법은 우리가 인증 사용자 이름을 얻을 때 "표준"에 프로그래밍 방식으로 편지를 쓰는 것이 었습니다.
타이밍이있는 무언가가 100% 신뢰할 수 없으므로 자격 증명을 다른 방식으로 OpenVPN으로 전달 하고이 게시물을 발견 할 수있는 방법을 찾고있었습니다. OpenVPN 게시물
-enable-password-save 옵션으로 소스를 다시 컴파일 할 수 있다고합니다. 누구든지 이것을 할 수 있었습니까?
마지막 질문은 다음과 같습니다. 클라이언트 측에서 Auth Username/Password를 OpenVpn.exe에 어떻게 전달할 수 있습니까? 그리고 OpenVPngui는 어떻게 든 이것을합니까 (아마도 우리는 그들이하는 일을 복사 할 수 있습니까)?
해결책 3
It turns out the problem wasn't with standard in.
I was using some locking where if the process exited in the middle of writing to standard in, there could be a deadlock.
There is no issue sending the password in this manner.
다른 팁
It's possible to open a VPN connection via a script by using the following DOS command (however this is not recommended since the password is not encrypted)
$openvpn.exe config.ovpn < username < password
NOTE! param auth-user-pass not work if start by GUI "C:\Program Files\OpenVPN\config\name.ovpn"
Made start file start_openvpv.cmd (+ link to with "run as admin") with content:
cd C:\Users\Name\Documents\VPN
"C:\Program Files\OpenVPN\bin\openvpn.exe" --config C:\Users\Name\Documents\VPN\myvpnconfig.ovpn --auth-user-pass "C:\Users\Name\Documents\VPN\pass.txt"
pass.txt:
yourusername
yourpassword
OR put line to name.ovpn, as in upper messege:
auth-user-pass pass.txt
+start_openvpv.cmd:
cd C:\Users\Name\Documents\VPN
"C:\Program Files\OpenVPN\bin\openvpn.exe" --config C:\Users\Name\Documents\VPN\myvpnconfig.ovpn
For automatic authentication to Openvpn you have to modify the config.ovpn file.
-Go to OpenVPN\config directory and edit the .ovpn file
-Add this line to the config file -> auth-user-pass password.txt
-Then create the password.txt file and write in it:
yourusername
yourpassword
-After these steps your openvpn will connect automatically.