1

I'm looking to add a default timeout to the ssh-agent run by macos at startup. So far I've determined that the file that runs this is /System/Library/LaunchAgents/com.openssh.ssh-agent.plist which contains:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.openssh.ssh-agent</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/ssh-agent</string>
        <string>-l</string>
    </array>
    <key>Sockets</key>
    <dict>
        <key>Listeners</key>
        <dict>
            <key>SecureSocketWithKey</key>
            <string>SSH_AUTH_SOCK</string>
        </dict>
    </dict>
    <key>EnableTransactions</key>
    <true/>
</dict>
</plist>

Now I think I'm able to add to the program arguments array (tell me if I'm not) but it caught my eye that it contains -l which I cannot find in any documentation. Does someone have any idea why? Should I remove it?

2
  • You can‘t modify files in /System. Can‘t the timeout be set in a config file?
    – nohillside
    Commented Apr 15 at 18:47
  • With AddKeysToAgent you can set a timeout of the added key, and yes that is nice, but I was trying to see if there was some way to do that even if I added the key with ssh-add and not having to type -t 86400 every time. Yes it is a silly sidequest but it lead me to the question of -l which is the focus here. Commented Apr 15 at 18:54

1 Answer 1

4

The -l seems to configure some sockets specifically for the use with launchd: https://github.com/apple-oss-distributions/OpenSSH/blob/9b6202341ee10b42e7391229ad5c0f2eb8aea8af/openssh/ssh-agent.c#L2378

You must log in to answer this question.

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