티스토리 뷰
openvpn 인증서 = ID 매칭 (스크립트)
: OPENVPN 인증서와 로그인 하는 아이디를 검증하여 로그인 아이디 = 인증서 가 맞으면 로그인 허용함
원문
https://serverfault.com/questions/358855/how-to-prevent-users-from-sharing-certificates-in-openvpn |
디렉토리 생성
mkdir /etc/openvpn/script
|
vim /etc/openvpn/scripts/check_cn_on_connect.sh (파일 생성)
#!/bin/bash # username and common_name must be the same to allow access. # users are not allowed to share their cert if [ $username != $common_name ]; then echo "$(date +%Y%m%d-%H%M%S) DENIED username=$username cert=$common_name" >> /var/log/openvpn-access.log exit 1 fi echo "$(date +%Y%m%d-%H%M%S) GRANTED username=$username cert=$common_name" >> /var/log/openvpn-access.log exit 0
|
vim /etc/openvpn/server.conf (라인추가)
# 인증서 검증 (사용자 인증서 = 사용자 계정) script-security 2 # untrusted state auth-user-pass-verify /etc/openvpn/scripts/check_cn_on_connect.sh via-env
|
권한 설정
chmod +x /etc/openvpn/scripts/check_cn_on_connect.sh chown nobody.nobody check_cn_on_connect.sh
|
로그 파일 생성 및 권한 설정
touch /var/log/openvpn-access.log chown nobody.nobody /var/log/openvpn-access.log
|
'VPN' 카테고리의 다른 글
openvpn 인증서 = ID 매칭 (0) | 2018.07.02 |
---|---|
strongswan (0) | 2018.06.14 |
중국 USIM (0) | 2018.06.12 |
SSTP (softether) 설치 (0) | 2018.04.05 |
openvpn tcp 설정 (0) | 2018.03.16 |
softether bridge 설정 (0) | 2018.03.16 |
- Total
- 696,225
- Today
- 145
- Yesterday
- 195