How to stop ssh-agent from being started on login/boot
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
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?
macos high-sierra ssh
add a comment |Â
up vote
3
down vote
favorite
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?
macos high-sierra ssh
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
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?
macos high-sierra ssh
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?
macos high-sierra ssh
edited Aug 12 at 17:52


bmike♦
149k45264582
149k45264582
asked Aug 12 at 17:41


ffxsam
18618
18618
add a comment |Â
add a comment |Â
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.
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.
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 stopssh-agent
, and then see if you can then getoh-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
add a comment |Â
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.
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.
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 stopssh-agent
, and then see if you can then getoh-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
add a comment |Â
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.
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.
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 stopssh-agent
, and then see if you can then getoh-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
add a comment |Â
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.
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.
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.
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.
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 stopssh-agent
, and then see if you can then getoh-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
add a comment |Â
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 stopssh-agent
, and then see if you can then getoh-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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password