How to stop ssh-agent from being started on login/boot

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite
1












I noticed ssh-agent is started automatically upon login. I'd rather it not do this, as I'd prefer oh-my-zsh to start the ssh-agent instead (since it automatically adds my id_rsa which is a nice feature).



I've tried tracking down where this is getting started, but I don't see anything. How do I disable it?







share|improve this question


























    up vote
    3
    down vote

    favorite
    1












    I noticed ssh-agent is started automatically upon login. I'd rather it not do this, as I'd prefer oh-my-zsh to start the ssh-agent instead (since it automatically adds my id_rsa which is a nice feature).



    I've tried tracking down where this is getting started, but I don't see anything. How do I disable it?







    share|improve this question
























      up vote
      3
      down vote

      favorite
      1









      up vote
      3
      down vote

      favorite
      1






      1





      I noticed ssh-agent is started automatically upon login. I'd rather it not do this, as I'd prefer oh-my-zsh to start the ssh-agent instead (since it automatically adds my id_rsa which is a nice feature).



      I've tried tracking down where this is getting started, but I don't see anything. How do I disable it?







      share|improve this question














      I noticed ssh-agent is started automatically upon login. I'd rather it not do this, as I'd prefer oh-my-zsh to start the ssh-agent instead (since it automatically adds my id_rsa which is a nice feature).



      I've tried tracking down where this is getting started, but I don't see anything. How do I disable it?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 12 at 17:52









      bmike♦

      149k45264582




      149k45264582










      asked Aug 12 at 17:41









      ffxsam

      18618




      18618




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          The launch daemon (launchd) is responsible for starting processes at boot, on demand, on schedule, in response to incoming network port connections and when a user is logged in.



          You often get lucky checking the listing with grep:



          launchctl list | grep ssh-agent


          In this case, it's the openssh prefernence that starts things:



          launchctl list com.openssh.ssh-agent


          You can edit the preference file or use a tool like LaunchControl or Lingon if you like contextual help, graphical tools and syntax checking. Apple's launchd/launchctl documentation exists but is dense, descriptive (rather than narrative / educational / proscriptive or basically easy to learn and use).



          Here's an example how it shows an error with this specific agent on my Mac and a helpful warning that I need to disable SIP before futzing with this specific job or agent.



          enter image description here



          If you want to unload / disable this you need to find where the preference is stored then edit it or tell launchctl to unload (permanently) that item:



          mdfind ssh-agent|grep plist
          launchctl unload -w /System/Library/LaunchAgents/com.openssh.ssh-agent.plist
          sudo launchctl disable system/com.openssh.ssh-agent


          The daemons like this system one are being transitioned from the old "unload" syntax to the new "enable|disable" syntax, so you might get different results from my above commands on different versions and builds of macOS. Since you can see when it's running and kill it manually (killall ssh-agent) you should have good success with this extra info on launch daemon that's not on most articles for unix management of this ssh tool.






          share|improve this answer






















          • Given all of the above, especially if SIP prevents you from disabling this directly, I would probably attack it a different way. The first idea that comes to mind would be to write my own launchd plist and have it run on load to have it run the commands to automatically stop ssh-agent, and then see if you can then get oh-my-zsh to restart / control it. You can put a launch plist in /Library/LaunchDaemons/ and have it run as root, which is probably what you need. I hope that helps. BTW if you do any work with launchd, I highly recommend LaunchControl. It's a great app.
            – TJ Luoma
            Aug 12 at 21:34










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "118"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fapple.stackexchange.com%2fquestions%2f333504%2fhow-to-stop-ssh-agent-from-being-started-on-login-boot%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote













          The launch daemon (launchd) is responsible for starting processes at boot, on demand, on schedule, in response to incoming network port connections and when a user is logged in.



          You often get lucky checking the listing with grep:



          launchctl list | grep ssh-agent


          In this case, it's the openssh prefernence that starts things:



          launchctl list com.openssh.ssh-agent


          You can edit the preference file or use a tool like LaunchControl or Lingon if you like contextual help, graphical tools and syntax checking. Apple's launchd/launchctl documentation exists but is dense, descriptive (rather than narrative / educational / proscriptive or basically easy to learn and use).



          Here's an example how it shows an error with this specific agent on my Mac and a helpful warning that I need to disable SIP before futzing with this specific job or agent.



          enter image description here



          If you want to unload / disable this you need to find where the preference is stored then edit it or tell launchctl to unload (permanently) that item:



          mdfind ssh-agent|grep plist
          launchctl unload -w /System/Library/LaunchAgents/com.openssh.ssh-agent.plist
          sudo launchctl disable system/com.openssh.ssh-agent


          The daemons like this system one are being transitioned from the old "unload" syntax to the new "enable|disable" syntax, so you might get different results from my above commands on different versions and builds of macOS. Since you can see when it's running and kill it manually (killall ssh-agent) you should have good success with this extra info on launch daemon that's not on most articles for unix management of this ssh tool.






          share|improve this answer






















          • Given all of the above, especially if SIP prevents you from disabling this directly, I would probably attack it a different way. The first idea that comes to mind would be to write my own launchd plist and have it run on load to have it run the commands to automatically stop ssh-agent, and then see if you can then get oh-my-zsh to restart / control it. You can put a launch plist in /Library/LaunchDaemons/ and have it run as root, which is probably what you need. I hope that helps. BTW if you do any work with launchd, I highly recommend LaunchControl. It's a great app.
            – TJ Luoma
            Aug 12 at 21:34














          up vote
          2
          down vote













          The launch daemon (launchd) is responsible for starting processes at boot, on demand, on schedule, in response to incoming network port connections and when a user is logged in.



          You often get lucky checking the listing with grep:



          launchctl list | grep ssh-agent


          In this case, it's the openssh prefernence that starts things:



          launchctl list com.openssh.ssh-agent


          You can edit the preference file or use a tool like LaunchControl or Lingon if you like contextual help, graphical tools and syntax checking. Apple's launchd/launchctl documentation exists but is dense, descriptive (rather than narrative / educational / proscriptive or basically easy to learn and use).



          Here's an example how it shows an error with this specific agent on my Mac and a helpful warning that I need to disable SIP before futzing with this specific job or agent.



          enter image description here



          If you want to unload / disable this you need to find where the preference is stored then edit it or tell launchctl to unload (permanently) that item:



          mdfind ssh-agent|grep plist
          launchctl unload -w /System/Library/LaunchAgents/com.openssh.ssh-agent.plist
          sudo launchctl disable system/com.openssh.ssh-agent


          The daemons like this system one are being transitioned from the old "unload" syntax to the new "enable|disable" syntax, so you might get different results from my above commands on different versions and builds of macOS. Since you can see when it's running and kill it manually (killall ssh-agent) you should have good success with this extra info on launch daemon that's not on most articles for unix management of this ssh tool.






          share|improve this answer






















          • Given all of the above, especially if SIP prevents you from disabling this directly, I would probably attack it a different way. The first idea that comes to mind would be to write my own launchd plist and have it run on load to have it run the commands to automatically stop ssh-agent, and then see if you can then get oh-my-zsh to restart / control it. You can put a launch plist in /Library/LaunchDaemons/ and have it run as root, which is probably what you need. I hope that helps. BTW if you do any work with launchd, I highly recommend LaunchControl. It's a great app.
            – TJ Luoma
            Aug 12 at 21:34












          up vote
          2
          down vote










          up vote
          2
          down vote









          The launch daemon (launchd) is responsible for starting processes at boot, on demand, on schedule, in response to incoming network port connections and when a user is logged in.



          You often get lucky checking the listing with grep:



          launchctl list | grep ssh-agent


          In this case, it's the openssh prefernence that starts things:



          launchctl list com.openssh.ssh-agent


          You can edit the preference file or use a tool like LaunchControl or Lingon if you like contextual help, graphical tools and syntax checking. Apple's launchd/launchctl documentation exists but is dense, descriptive (rather than narrative / educational / proscriptive or basically easy to learn and use).



          Here's an example how it shows an error with this specific agent on my Mac and a helpful warning that I need to disable SIP before futzing with this specific job or agent.



          enter image description here



          If you want to unload / disable this you need to find where the preference is stored then edit it or tell launchctl to unload (permanently) that item:



          mdfind ssh-agent|grep plist
          launchctl unload -w /System/Library/LaunchAgents/com.openssh.ssh-agent.plist
          sudo launchctl disable system/com.openssh.ssh-agent


          The daemons like this system one are being transitioned from the old "unload" syntax to the new "enable|disable" syntax, so you might get different results from my above commands on different versions and builds of macOS. Since you can see when it's running and kill it manually (killall ssh-agent) you should have good success with this extra info on launch daemon that's not on most articles for unix management of this ssh tool.






          share|improve this answer














          The launch daemon (launchd) is responsible for starting processes at boot, on demand, on schedule, in response to incoming network port connections and when a user is logged in.



          You often get lucky checking the listing with grep:



          launchctl list | grep ssh-agent


          In this case, it's the openssh prefernence that starts things:



          launchctl list com.openssh.ssh-agent


          You can edit the preference file or use a tool like LaunchControl or Lingon if you like contextual help, graphical tools and syntax checking. Apple's launchd/launchctl documentation exists but is dense, descriptive (rather than narrative / educational / proscriptive or basically easy to learn and use).



          Here's an example how it shows an error with this specific agent on my Mac and a helpful warning that I need to disable SIP before futzing with this specific job or agent.



          enter image description here



          If you want to unload / disable this you need to find where the preference is stored then edit it or tell launchctl to unload (permanently) that item:



          mdfind ssh-agent|grep plist
          launchctl unload -w /System/Library/LaunchAgents/com.openssh.ssh-agent.plist
          sudo launchctl disable system/com.openssh.ssh-agent


          The daemons like this system one are being transitioned from the old "unload" syntax to the new "enable|disable" syntax, so you might get different results from my above commands on different versions and builds of macOS. Since you can see when it's running and kill it manually (killall ssh-agent) you should have good success with this extra info on launch daemon that's not on most articles for unix management of this ssh tool.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 12 at 18:16

























          answered Aug 12 at 18:10









          bmike♦

          149k45264582




          149k45264582











          • Given all of the above, especially if SIP prevents you from disabling this directly, I would probably attack it a different way. The first idea that comes to mind would be to write my own launchd plist and have it run on load to have it run the commands to automatically stop ssh-agent, and then see if you can then get oh-my-zsh to restart / control it. You can put a launch plist in /Library/LaunchDaemons/ and have it run as root, which is probably what you need. I hope that helps. BTW if you do any work with launchd, I highly recommend LaunchControl. It's a great app.
            – TJ Luoma
            Aug 12 at 21:34
















          • Given all of the above, especially if SIP prevents you from disabling this directly, I would probably attack it a different way. The first idea that comes to mind would be to write my own launchd plist and have it run on load to have it run the commands to automatically stop ssh-agent, and then see if you can then get oh-my-zsh to restart / control it. You can put a launch plist in /Library/LaunchDaemons/ and have it run as root, which is probably what you need. I hope that helps. BTW if you do any work with launchd, I highly recommend LaunchControl. It's a great app.
            – TJ Luoma
            Aug 12 at 21:34















          Given all of the above, especially if SIP prevents you from disabling this directly, I would probably attack it a different way. The first idea that comes to mind would be to write my own launchd plist and have it run on load to have it run the commands to automatically stop ssh-agent, and then see if you can then get oh-my-zsh to restart / control it. You can put a launch plist in /Library/LaunchDaemons/ and have it run as root, which is probably what you need. I hope that helps. BTW if you do any work with launchd, I highly recommend LaunchControl. It's a great app.
          – TJ Luoma
          Aug 12 at 21:34




          Given all of the above, especially if SIP prevents you from disabling this directly, I would probably attack it a different way. The first idea that comes to mind would be to write my own launchd plist and have it run on load to have it run the commands to automatically stop ssh-agent, and then see if you can then get oh-my-zsh to restart / control it. You can put a launch plist in /Library/LaunchDaemons/ and have it run as root, which is probably what you need. I hope that helps. BTW if you do any work with launchd, I highly recommend LaunchControl. It's a great app.
          – TJ Luoma
          Aug 12 at 21:34

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fapple.stackexchange.com%2fquestions%2f333504%2fhow-to-stop-ssh-agent-from-being-started-on-login-boot%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          List of Gilmore Girls characters

          Confectionery