63

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.

0

8 Answers 8

45

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
12
  • This prevents AnyConnect from working for me.
    – Ryan
    Commented Oct 25, 2018 at 11:53
  • 1
    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
    Commented Feb 14, 2019 at 23:03
  • 4
    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
    Commented Jun 13, 2019 at 12:22
  • 3
    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
    Commented Jan 24, 2020 at 7:25
  • 3
    I would say delete it is stupid since as kapad did, you can't bring it back, only by reinstalling it. But, you can edit this file, and change the key's value "RunAtLoad" to false. that's it.
    – Shai Alon
    Commented Sep 29, 2020 at 18:35
38

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

NB: be careful NOT to run sudo launchctl and NOT to run launchctl from a root terminal, because launchctl is user-dependent. For example, trying to run sudo launchctl unload -w /Library/LaunchAgents/com.cisco.anyconnect.gui.plist results in an error "Could not find specified service", whereas without the sudo it works.

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/ Be careful where you use sudo since some of the agents and daemons run in user space and some run in system space and different versions of macOS have different syntax and shells.

2
  • 3
    Now this is a long time coming - what persistence to get a great answer here. Thank you
    – bmike
    Commented Jun 19, 2020 at 19:44
  • 2
    Thank you for a good answer and an excellent expansion
    – jalanb
    Commented Feb 5, 2021 at 20:15
16

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.

2
  • 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
    Commented Apr 29, 2016 at 19:13
  • 2
    This does not work for me using version 4.4.
    – Anthony
    Commented Sep 18, 2017 at 1:12
4

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... ?

5
  • 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
    Commented Feb 14, 2019 at 23:08
  • 1
    @MarcH how is this breaking it if Johan can still run it?
    – Mars
    Commented Sep 30, 2019 at 0:59
  • 1
    "works for me!"
    – MarcH
    Commented Sep 30, 2019 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
    Commented Nov 18, 2019 at 8:16
  • @Fuzzy76 that's a good point.
    – Mars
    Commented Nov 19, 2019 at 3:18
4

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>
2

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.

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.

1
  • As above: "breaking Any Connect which can have unintended consequences"
    – jalanb
    Commented Feb 5, 2021 at 20:18
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?

You must log in to answer this question.

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