R
R
rustem_ck2020-11-18 19:13:54
openvpn
rustem_ck, 2020-11-18 19:13:54

How to limit OpenVPN session time?

How can I limit the session time for example 1 hour?

What would after connecting, after 1 hour the client disconnected.

Already watched:
$ telnet localhost 7505
$ kill ip:port

They disconnect the client, but he can connect again (autoconnect).

server config

port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-crypt tc.key
topology subnet
server 10.8.0.0 255.255.255.0
push "redirect-gateway def1 bypass-dhcp"
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 67.207.67.2"
push "dhcp-option DNS 67.207.67.3"
keepalive 5 10
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
crl-verify crl.pem
explicit-exit-notify
duplicate-cn


client config
client
dev tun
proto udp
remote 157.230.57.160 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
ignore-unknown-option block-outside-dns
block-outside-dns
verb 3
ping-restart 0
ping-exit 5
connect-retry-max 1

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
ky0, 2020-11-18
@ky0

Of course, the user will be able to log in again - the certificate / password is valid for him. Disconnect and kill/change login details.

O
Oleg Volkov, 2020-11-19
@voleg4u

I have 2FA two-factor authentication - autoconnect does not work and everything falls off. Maybe you need it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question