Macos malware used runonly avoid for5/2/2023 To minimize my interactions with launchd, I created a single launchd job that calls a bash script. Your user launchd jobs (which run only when you are logged in) correctly use the SSH agent information that was unlocked via your keychain as part of login (as part of standard OS X key management, no other software required). Using launchd instead of cron does indeed fix the authorization problem. NOTE 2 - I realize that passphrase-less SSH keys would solve my problem however I'd prefer not to go this route.įor anyone who ends up on this page, I realized I should post the answer: Mac OS X Lion and sshpass) but it's specifically about a program sshpass that I don't use (although I believe that question would be answered by this one as well). NOTE 1 - before redirecting me - I'm aware there's a similar question here ( which I would think isn't necessary b/c of the Keychain Access configuration). Is this issue that I need to run ssh-add at some point in my login process? Running it from a standard bash prompt doesn't help the cron job out (although, oddly, it does prompt me for my passphrase. ssh/id_dsa file - as a result I can SSH from a terminal prompt without ever having to enter my passphrase. Note that I've got Keychain Access setup so that ssh, ssh-agent, and ssh-add are allowed to read my passphrase for my. In other words, it's expecting me to type in the passphrase for ~/.ssh/id_dsa, which of course doesn't work in cron jobs. SSH_AGENT_PID=17148 export SSH_AGENT_PID īut the ssh -vvv output shows that it fails right when the private key should be read: debug1: Server accepts key: pkalg ssh-dss blen 818ĭebug1: read_passphrase: can't open /dev/tty: Device not configuredĭebug2: no passphrase given, try next key The ssh-agent output looks normal: SSH_AUTH_SOCK=/tmp/ssh-QRxPUMRxbu/agent.17147 export SSH_AUTH_SOCK When run from the command prompt, this script works as expected. Whoami # just to verify I'm running as myself, not root Here's a bowdlerized version of my called-from-cron script that worked great under Snow Leopard: #!/bin/bash It appears that ssh-agent is no longer functioning as expected. Just upgraded from Snow Leopard to Lion, and my cron jobs that use ssh have stopped working.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |