39

So I am currently running:

  • OS X 10.10.5
  • Cisco AnyConnect Secure Mobility Client 4.1.04011

I boot up my laptop and AnyConnect is running. I go into Preferences...Users & Groups and remove /Applications/Cisco/Cisco from my list of login items then I quit AnyConnect.

Shut down...turn computer on later and it's back running and it's back in my login items list.

The company I work for only uses AnyConnect for VPN.

Is there a way for me to keep AnyConnect out of my login items list? It's not that I mind it running in the background but if it is it's in my command + tab, etc... and I just find it annoying.

29

Removing the following worked for me.

  • /Library/LaunchAgents/com.cisco.anyconnect.vpnagent.plist
  • /Library/LaunchDaemons/com.cisco.anyconnect.gui.plist

Update: For macOS Catalina and anyconnect 4.7.x removing this single file seems to be enough:

  • /Library/LaunchAgents/com.cisco.anyconnect.gui.plist
| improve this answer | |
  • This prevents AnyConnect from working for me. – Ryan Oct 25 '18 at 11:53
  • My understanding is LaunchDaemons start at boot while LaunchAgents start at login. Can you explain in a little more detail how LaunchDaemons are relevant or if my understanding isn’t correct? – MarcH Feb 14 '19 at 23:03
  • 2
    Just removed com.cisco.anyconnect.gui.plist from /Library/LaunchAgents/ worked for me. The GUI does not start any more at login, but I can still start the app when needed. – Henrik Jun 13 '19 at 12:22
  • 1
    I can confirm in macOS Catalina that just removing /Library/LaunchAgents/com.cisco.anyconnect.gui.plist did the trick. The app does not start automatically but can be started manually without any problem. This is the most elegant solution if you don't want to reinstall again. – otmezger Jan 24 at 7:25
  • I am on Mojave. There is no subfolder in user names's /Library/LaunchDaemons/ – chikitin Mar 31 at 11:38
14

So it would seem that if you only install the VPN client AnyConnect will not autostart.

I uninstalled AnyConnect (version 4.x) then reinstalled doing a custom install. I only installed VPN, I did not install:

  • Web Security
  • AMP Enabler
  • Diagnostics and Reporting Tool
  • Posture
  • ISE Posture

Now AnyConnect no longer auto starts (yeah!)

Makes sense I suppose as the other parts that get installed by default are there to "protect" your system.

| improve this answer | |
  • Would you be able to tell which of the daemons under Library/LaunchDaemons is there? I'm having the same problem, and I have these: com.cisco.anyconnect.aciseagentd.plist com.cisco.anyconnect.ciscod.plist com.cisco.anyconnect.vpnagentd.plist – Throsby Apr 29 '16 at 19:13
  • This does not work for me using version 4.4. – Anthony Sep 18 '17 at 1:12
6

If it's not in "Login Items" then it has to be in launchctl. Always prefer the user interface when there is one rather than messing with files directly:

 launchctl list | grep -i cisco
 launchctl unload -w /Library/LaunchAgents/com.cisco.anyconnect.gui.plist
 launchctl list | grep -i cisco

 # Load it back
 launchctl load -w /Library/LaunchAgents/com.cisco.anyconnect.gui.plist
 launchctl list | grep -i cisco

When there's a user interface it's very likely because it does more than just moving one file. Don't take the risk to miss those extra bits; use the official and documented user interface.

launchctl is the equivalent of systemd on Linux or services.msc on Windows. Every mac user should have at least some vague idea of what launchctl does because it manages far more than AnyConnect: basically every process not manually started by the user.

launchctl is documented in (surprise) man launchctl but that's not for the faint of heart. For a friendlier documentation that does not assume you already know the difference between "loading" versus "starting" or between a "daemon" vs a "service" or an "agent" go to http://www.launchd.info/ first.

As a bonus and slightly off-topic answer, here's a clean way to restart the AnyConnect daemon in case it gets stuck as it sometimes does. This is the other, lower-level AnyConnect process(es) without any user interface and running as root that does the actual work:

  sudo launchctl kickstart -kp system/com.cisco.anyconnect.vpnagentd

Avoid kill and killall, see why on http://www.launchd.info/

| improve this answer | |
  • 1
    Now this is a long time coming - what persistence to get a great answer here. Thank you – bmike Jun 19 at 19:44
3

This has been driving me crazy. I finally discovered the 3 plist files that appear to control this in /Library/LaunchDaemons. But I couldn't change the RunAtLoad parameter to false, because even after I changed the file permissions I couldn't save the plist files. I finally changed the folder permissions to read and write and applied those changes to the contained items, and at last I've been able to edit and save. I'll know for sure after the next reboot ... something I'll do in a few days because starting up again takes forever.

| improve this answer | |
2

Forget about tricky removals of plists and stuff like that, just rename Cisco AnyConnect Secure Mobility Client in Finder, that´s it.

Edit: Strange I got a downvote, because I just tested it myself, and it works without any problems at all. Perhaps not a beautiful solution that addresses the underlaying problem (by design ?), nevertheless... ?

| improve this answer | |
  • 1
    Tricky or not plists are the official and documented way to configure autostart. Instead you recommend breaking Any Connect which can have unintended consequences. – MarcH Feb 14 '19 at 23:08
  • 1
    @MarcH how is this breaking it if Johan can still run it? – Mars Sep 30 '19 at 0:59
  • "works for me!" – MarcH Sep 30 '19 at 16:13
  • 1
    @mars Cisco has a lot more functionality than showing its GUI. Unless every single functionality and configuration has been extensively tested in this setup, I would still categorize it as "risky". – Fuzzy76 Nov 18 '19 at 8:16
  • @Fuzzy76 that's a good point. – Mars Nov 19 '19 at 3:18
1

I managed to stop the client from launching at startup.

I achieved this by just moving the folder Cisco from Applications to any other location, let's say for instance Desktop: sudo mv /Applications/Cisco/ /Users/{your-user}/Desktop/Cisco

I think it has nothing to do with the destination folder. Just moving it from the Applications folder is enough to stop the process that starts it from finding it.

| improve this answer | |
0

It is not the permission of the file itself that prevents you from editing, it is the permission of the containing folder. Then, you should not change the permissions of such system files for security reasons. But it is easy to edit these files: Simply copy them to some other place where you have permission to write to files, e.g. the Desktop, and edit the files there. Then move them back in with replacing option and authenticating as an administrator and the file is edited.

However, I do not see those three files you seem to mention. I find on my system only 'com.cisco.anyconnect.ciscod.plist' and 'com.cisco.anyconnect.vpnagentd.plist' in the directory '/Library/LaunchAgents'. Perhaps more importantly, while setting in these two files the parameter 'RunAtLoad' to 'false' indeed prevents the annoying reinstallation of the application 'Cisco AnyConnect Secure Mobility Client.app' as a login item after a restart, it also makes the vpn in general disfunctional.

Has anyone found actually a solution?

| improve this answer | |
0

This same topic is discussed on the Cisco forum:

AnyConnect Secure Mobility - Disable the automatic launch on login

https://community.cisco.com/t5/vpn/anyconnect-secure-mobility-disable-the-automatic-launch-on-login/td-p/2062460

The accepted solution there is to set AutoConnectOnStart to false in the "XML Profile" located at /opt/cisco/anyconnect/profile/.

<AutoConnectOnStart UserControllable="true">false</AutoConnectOnStart>

They provide an example XML profile 137498-AnyConnect.xml, which they claim should stop the app from opening at login:

<?xml version="1.0" encoding="UTF-8"?>
<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/encoding/ AnyConnectProfile.xsd">
    <ClientInitialization>
        <UseStartBeforeLogon UserControllable="true">false</UseStartBeforeLogon>
        <AutomaticCertSelection UserControllable="true">true</AutomaticCertSelection>
        <ShowPreConnectMessage>false</ShowPreConnectMessage>
        <CertificateStore>All</CertificateStore>
        <CertificateStoreOverride>false</CertificateStoreOverride>
        <ProxySettings>Native</ProxySettings>
        <AllowLocalProxyConnections>false</AllowLocalProxyConnections>
        <AuthenticationTimeout>12</AuthenticationTimeout>
        <AutoConnectOnStart UserControllable="true">false</AutoConnectOnStart>
        <MinimizeOnConnect UserControllable="true">true</MinimizeOnConnect>
        <LocalLanAccess UserControllable="true">false</LocalLanAccess>
        <ClearSmartcardPin UserControllable="true">true</ClearSmartcardPin>
        <AutoReconnect UserControllable="false">true
            <AutoReconnectBehavior UserControllable="false">DisconnectOnSuspend</AutoReconnectBehavior>
        </AutoReconnect>
        <AutoUpdate UserControllable="false">true</AutoUpdate>
        <RSASecurIDIntegration UserControllable="false">Automatic</RSASecurIDIntegration>
        <WindowsLogonEnforcement>SingleLocalLogon</WindowsLogonEnforcement>
        <WindowsVPNEstablishment>LocalUsersOnly</WindowsVPNEstablishment>
        <AutomaticVPNPolicy>false</AutomaticVPNPolicy>
        <PPPExclusion UserControllable="false">Automatic
            <PPPExclusionServerIP UserControllable="false"></PPPExclusionServerIP>
        </PPPExclusion>
        <EnableScripting UserControllable="false">false</EnableScripting>
        <EnableAutomaticServerSelection UserControllable="true">false
            <AutoServerSelectionImprovement></AutoServerSelectionImprovement>
            <AutoServerSelectionSuspendTime></AutoServerSelectionSuspendTime>
        </EnableAutomaticServerSelection>
        <RetainVpnOnLogoff>false
        </RetainVpnOnLogoff>
    </ClientInitialization>
</AnyConnectProfile>
| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .