Ik wil voor een crontab zorgen dat ik zonder password kan inloggen op een ander systeem. Ik heb inmiddels een public en private key, maar krijg het niet voor elkaar om de public key in het geheugen te houden, zodat ik m'n passphrase niet in hoef te voeren. Binnen 1 sessie gaat alles goed, maar als ik opnieuw inlog werkt het niet meer.
Het script om de agent te laden is:
Als ik opnieuw inlog, dan draait ssh-agent wel volgens ps aux, maar ssh-add -l geeft:
Could not open a connection to your authentication agent.
Het script om de agent te laden is:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| #!/bin/bash
# Creates an ssh-agent, writes ssh agent info
# to the file '~/.ssh-agent-info' and then prompts
# user for keys. Then any shell can use the agent
# by sourcing the contents of ~/.ssh-agent-info:
# . ~/ssh-agent-info
ssh-agent >~/.ssh-agent-info
chmod 600 .ssh-agent-info
. .ssh-agent-info
for i in identity
do
ssh-add .ssh/$i
done
echo "Don't forget to '. .ssh-agent-info'" |
Als ik opnieuw inlog, dan draait ssh-agent wel volgens ps aux, maar ssh-add -l geeft:
Could not open a connection to your authentication agent.