How to disconnect from OpenConnect?
By Michael Henderson •
I command something like this : sudo openconnect -b serverName for connect to vpn but when i want to disconnect it , the process does not kill and its alive in background.
I used these commands for disconnecting but they did not work for me in ubuntu 20.10 :
1-sudo killall openconnect
2-use ctrl + c
2 Answers
You can use something more powerful like kill -9.
First find out PID number like so:
pgrep openconnect
12345After that, kill the process with: sudo kill -9 12345.
One liner can also be used
kill -9 `pgrep openconnect` 3 IF you have more than one and want to script it you can run this:
pgrep openconnect | while read line ; do sudo kill -9 $line ; done