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 ...
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 ...
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 ...
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
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
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 ...
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. ...
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 ...
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 ...
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; ...
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=...
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\...
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 ...
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....
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 ...
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 ...
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....
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 ...
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 ...
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 ...
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 ...
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 ...
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 &...
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 ...
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'
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.
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 ...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
openconnect × 48vpn × 23
networkmanager × 10
networking × 9
centos × 6
cisco × 6
arch-linux × 4
fedora × 4
openvpn × 4
debian × 3
iptables × 3
linux × 2
ssh × 2
terminal × 2
dns × 2
routing × 2
certificates × 2
resolv.conf × 2
bash × 1
shell-script × 1
ubuntu × 1
scripting × 1
linux-mint × 1
wifi × 1
sudo × 1