找回密码
 注册
查看: 632|回复: 0

openvpn 服务吊销客户端证书操作步骤

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2025-6-8 10:12:18 | 显示全部楼层 |阅读模式
吊销客户端证书
当我们创建了多个用户使用,然后某些原因,个别用户需要禁用的时候,我们就可以使用吊销证书的方式来处理。
首先在你的OpenVPN服务器上0
3 A/ u8 z3 _0 U1 A
先备份文件:
! a5 u4 I# W2 \, r2 E& ycp /data/openvpn/easy-rsa-server/pki/crl.pem{,.bak}  我们这里不用使用备份。
" m# y3 M- N" [$ }% G7 {+ p4 H2 t) D  + K% |' k2 ~! U+ j/ g0 U0 J! d
然后再执行下面的操作:4 n  f5 M8 C! N

& b/ c/ J/ [* j' K  Q2 e
./easyrsa revoke <client>  # 要吊销的客户端名

- I" G- Q1 u9 |! ]) o9 ^  f示例:
! c% l  b& ^8 g9 Y  W7 u0 S[root@vpnserver easy-rsa-server]# ./easyrsa revoke longrui3 Y$ T/ h" }5 I" ?9 }

# Q% S1 A8 b7 p  `7 k1 F" BNote: using Easy-RSA configuration from: /data/openvpn/easy-rsa-server/vars7 s% I, }. H' U6 Z
Using SSL: openssl OpenSSL 1.0.2k-fips  26 Jan 2017/ p. d3 W4 R0 i! N7 p8 y9 R

+ i5 i  ~, e# Y& V  d( CEasy-RSA error:
* U/ Y/ I! }, |. e# E, {0 w3 I
7 b: c. N! f& m$ dUnable to revoke as the input file is not a valid certificate. Unexpected
$ v+ ~* L, [; D% ~# ]) l# Pinput in file: /data/openvpn/easy-rsa-server/pki/issued/longrui.crt
( n4 }2 B: [/ d$ W4 n8 `- _$ x
( c3 p; s9 W, u( k; c! O& R2 M" X8 b./easyrsa gen-crl    # 生成crl.pem文件,用来记录吊销的证书
9 [# [# [/ Y7 N8 C6 O' V  X) O0 N示例:5 t5 L6 x6 [/ L# h" @: x. J( \
[root@vpnserver easy-rsa-server]# ./easyrsa gen-crl6 P" R$ r. ^6 J% N; H, J* j/ J

; Y' F2 Z2 ~$ I0 M: P5 jNote: using Easy-RSA configuration from: /data/openvpn/easy-rsa-server/vars4 s. U( \1 P, q
Using SSL: openssl OpenSSL 1.0.2k-fips  26 Jan 2017
2 V9 U8 L: G5 G% N5 c& FUsing configuration from /data/openvpn/easy-rsa-server/pki/easy-rsa-5235.iIUYZT/tmp.kofT2G
/ W9 k! N9 d2 C
$ I$ t% Q; F  \An updated CRL has been created.
: m9 _0 ^% U% {6 c: o% kCRL file: /data/openvpn/easy-rsa-server/pki/crl.pem( Q! r# q5 i/ o7 d& y8 J( h
7 q2 u  t- ?5 H6 ~) o
接下来操作:  x7 b4 @1 Y/ l
cat /data/openvpn/easy-rsa-server/pki/crl.pem >> /data/openvpn/easy-rsa-server/pki/crl.pem.bak, m. n+ _0 F% m' A$ M
编辑server.conf文件,插入一行:
6 C; \- c/ J, ?+ u5 Y+ b) h0 @0 S& U
###告知服务端有哪些证书是被吊销的
& N9 \6 O/ V, b  ucrl-verify /data/openvpn/easy-rsa-server/pki/crl.pem.bak  a7 J# i, Y$ t6 d7 W1 F8 N

: o; L; p4 b6 m
8 d9 `' e6 L9 R # 用来告知服务端有哪些证书是被吊销的2 l' X, t* L8 R$ x6 I1 w/ ~

( [7 @' K% I0 R9 z& s1 p  O7 w# k7 \重启下vpn服务
7 ]. i" S9 \# Y3 D, c* Q  r" T+ U- E, V2 {, k6 K7 r" i4 m8 m% w! [
' s! n: l" N1 Z% F0 [
1 \4 y7 z3 @- o" E' N1 q
1 x( @% S/ |+ I- }5 x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 00:47 , Processed in 0.019536 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表