Skip to main content
22 votes

How can I use openconnect in the background

To connect: sudo openconnect --background <...> To disconnect: sudo killall -SIGINT openconnect Using SIGINT gives the background process time to clean up the DNS configuration and exit ...
Saintali's user avatar
  • 321
21 votes
Accepted

ssh installed but I get the error: Failed to start ssh.service: Unit ssh.service not found

The ssh binary, the SSH client, is provided by the openssh-client package, which is installed on your system. The ssh service runs the SSH server, provided by the openssh-server package, which isn’t ...
Stephen Kitt's user avatar
13 votes

OpenConnect: Setting default routes

I found that the best way to achieve split tunneling is to use vpn-slice. You basically can tell which routes you want and it will be your vpn script that does the routing, instead of what the ...
Farid Nouri Neshat's user avatar
11 votes
Accepted

How can I use openconnect in the background

According to the Openconnect documentation, the option you would want to try would be: -b,--background Continue in background after startup
GracefulRestart's user avatar
10 votes

ssh installed but I get the error: Failed to start ssh.service: Unit ssh.service not found

Your SSH package/daemon/service is not installed. For installing the SSH service on Ubuntu, you run: sudo apt-get install openssh-server see Packages - openssh-server - xenial
Rui F Ribeiro's user avatar
9 votes

How to stop openconnect from changing DNS settings

Posting as an answer rather than a comment to give it some visibility. I am not sure whether there is a better way for just citing other site's answers. But https://serverfault.com/a/900825 is an ...
Harald's user avatar
  • 1,040
8 votes

How can I use openconnect in the background

Yes. -b is the option. But that just leads to the next issue: A clean disconnect then is not possible anymore. I mean, the only way to exit openconnect when it is in background is to kill the process. ...
forty2's user avatar
  • 81
7 votes

Openconnect won't connect in Arch Linux

I just had this problem. The other solution didn't work for me, but after a bit of Googling, I found this thread which explains/hypothesize that the issue has been caused by pacman -Syu which has ...
Mehrad's user avatar
  • 843
5 votes
Accepted

Namservers reverted to normal shortly after connecting VPN using Openconnect

Systemd-Resolved usually handles changing /etc/resolv.conf based on the network you're connecting to: When connecting to a network, it will change /run/systemd/resolve/resolv.conf, in some cases on ...
Patrick's user avatar
  • 599
5 votes
Accepted

How to shut down openconnect cleanly?

Yes, Ctrl-C (i.e. SIGINT) cleanly shuts it down, according to https://www.infradead.org/openconnect/manual.html#heading5. Personally I run openconnect in a terminal and use Ctrl-C to shut it down; ...
Robert Fleming's user avatar
4 votes

How to set a VPN connection in nmcli?

I can show you my configuration for a cisco anyconnect configuration on Debian 11. The .nmconnection file is stored in /etc/NetworkManager/system-connetictions. [connection] id=CONNECTION_NAME uuid=...
buhtz's user avatar
  • 965
4 votes
Accepted

OpenConnect: Passing-over user password when executing authentication request?

Usually, VPN software does not allow as input the password for a user, because it is considered a security risk. A possible solution is feeding the password via a pipe as in: echo -e "Tunnel all\...
Rui F Ribeiro's user avatar
3 votes
Accepted

What is the correct way to install openconnect(ocserv-0.12.3-1.el7) package on CentOs 7

As version 0.12.3 is EPEL candidate you can install it via downloading the package (RPM) and install it. Or compile it from source. But I will recommend you to install available in EPEL package and do ...
Romeo Ninov's user avatar
  • 19.5k
3 votes
Accepted

ConnMan: How to set up OpenConnect VPN with CSD-Wrapper correctly?

Thanks to a comment from GAD3R and the Connman developer mailing list, a friend figured out on how to set up the VPN connection. Although there is still a small error existent we got it work mostly. 1....
Dave's user avatar
  • 1,056
3 votes
Accepted

Debian 9: Is there any GUI to add OpenConnect VPN-connection in ConnMan?

To configure your VPN file you can use connman_dmenu: # apt install suckless-tools $ git clone https://github.com/march-linux/connman_dmenu.git $ cd connman_dmenu # ./connman_dmenu You will be able ...
GAD3R's user avatar
  • 69.8k
2 votes

OpenConnect: Setting default routes

Here's a script which does split-tunnelling on both IPv4 and IPv6 networks (based on the script Aditya K provided, which still allowed caused all IPv6 traffic to be routed to the VPN). Note also that ...
atrus's user avatar
  • 51
2 votes

How can I use openconnect in the background

You can do this with screen or any other terminal multiplexer. With screen you can: start a new session with screen command connect to the VPN inside this new session openconnect -u username us....
ks1322's user avatar
  • 1,672
2 votes

How can I use openconnect in the background

Finally, I came up with this solution: Run openvpn command to connect to server. Then, press CTRL+Z to stop it and then type bg to make the stopped program continue in the background. To continue ...
Mehdi Haghgoo's user avatar
2 votes

How to shut down openconnect cleanly?

To kill openconnect or openconnect-sso ("OpenConnect Single Sign-On (SSO)": a wrapper which allows SAML 2-factor authentication via Okta, in place of the Cisco AnyConnect client) from ...
Gabriel Staples's user avatar
2 votes

VPN parameter useragent and NetworkManager

I've faced this issue recently, also connecting from Ubuntu 22.04. While @Uwe's answer provided a hint, to me it seemed unlikely that a binary ELF file would continue to work without issues if you ...
Andrei B's user avatar
  • 131
2 votes

VPN parameter useragent and NetworkManager

You left us with guesswork about your configuration. In case you're on Ubuntu 22.04, there's a known issue with OpenConnect, that passes "Open AnyConnect VPN Agent v$VERSION" as UserAgent by ...
Uwe's user avatar
  • 21
2 votes
Accepted

Why connecting to a VPN creates a new login from my local user?

When you use openconnect for a VPN, you might notice an extra login entry in the who list, like this: myself tty1 2025-01-14 17:47 myself pts/2 2025-02-03 07:17 This happens ...
Rafa Mori's user avatar
  • 293
1 vote

How to set a VPN connection in nmcli?

I found the clue by running: nmcli connection show CONNECTION_NAME For an already working connection. So here a piece of script to set up a VPN connection: # Helper error function fail() { echo &...
Juando's user avatar
  • 11
1 vote
Accepted

In tmux on remote machine, each new line in terminal is indented to the end of the previously displayed line

I wasn't able to reproduce this myself using a similar configuration, but it sounds like (and confirmed from the comments) that there may be a mismatch with the termcap and $TERM (st-256color) on the ...
NotTheDr01ds's user avatar
  • 4,012
1 vote

Alias a command with the Incoming Prompt Options

Update your alias to something like below: alias vvv='sudo openconnect serverAddress --authgroup=selectAuthGroup --user=UserName --passwd-on-stdin'
αғsнιη's user avatar
  • 41.9k
1 vote

openconnect nexthop has invalid gateway and invalid values for route get request

I had the same problem with Mandjaro Linux and the problem is gone after I upgraded the vpnc package manually to version 0.5.3.r468.r81-1.
Konrad Bucheli's user avatar
1 vote

openconnect nexthop has invalid gateway and invalid values for route get request

I believe this is because of added validation to ipconnect2 (which provides the ip utility) in version 5.x (Not sure which version specifically) vpnc-script, which is used by openconnect, builds CIDR ...
dotVezz's user avatar
  • 121
1 vote

Route all traffic through openconnect

The required changes to achieve what you are after would depend on the configuration on the VPN server side. It may not be configured to pass traffic to external networks. You can test this by adding ...
Yevhen Stasiv's user avatar
1 vote
Accepted

How to build openconnect-gui?

From the application sources you're linking: Supported Platforms Microsoft Windows 7 and newer macOS 10.11 and newer This isn't made readily available for Linux. There is no need to ...
A.B's user avatar
  • 39.5k
1 vote

Bash-Script: How to insert Variables into Bash-Script?

The same (correct) logic that you are applying when using strings in your first example has to be used when assigning strings to variables, too. In AUTHGROUP=tunnel My Company the three words are ...
fra-san's user avatar
  • 10.8k

Only top scored, non community-wiki answers of a minimum length are eligible