티스토리 뷰
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' 카테고리의 다른 글
shadowsocks (0) | 2019.03.11 |
---|---|
strongswan (0) | 2018.06.14 |
중국 USIM (0) | 2018.06.12 |
SSTP (softether) 설치 (0) | 2018.04.05 |
openvpn tcp 설정 (0) | 2018.03.16 |
- Total
- Today
- Yesterday
- Apache
- ntp
- iptables
- WAF
- OpenVPN
- glusterfs
- GeoIP
- SSL
- galera
- ssh
- centOS7
- softether
- mariadb
- 인증서
- gitlab
- mod_security
- HAProxy
- virtualbox
- centos8
- kvm
- L2TP
- cURL
- php
- NGINX
- 리눅스
- 베이어다이나믹
- yum
- pptp
- MySQL
- IPSEC
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |