linux - use user's SSH key in bash script -


i've written bash script that's automated using anacron in user mode. script executes rsync in ssh mode synchronize files. script should use user's default (password-encrypted) ssh key authenticate against ssh server.

this working expected, if run terminal directly. well-known dialog box popping up, prompting user unlock ssh key. however, if it's triggered anacron doesn't.

i can confirm anacron executes script in user mode, whoami returns correct username. dialog box not showing up. instead

ssh_askpass: exec(/usr/bin/ssh-askpass): no such file or directory 

is printed out. indeed, specified path doesn't exist.

my anacrontab looks this:

# /etc/anacrontab: configuration file anacron  # see anacron(8) , anacrontab(5) details.  shell=/bin/bash path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin  # period  delay  job-identifier  command 1         1      user.backup     /usr/local/bin/backup.sh -p ~/.nb/ssh.config >> /tmp/user.backup.log 2>&1 

anacron triggerd ~/.profile.
guess missed setup correct environment ssh key unlocking process in anacrontab.

what need make process working in place?

edit duplicate https://askubuntu.com/questions/900547/ssh-key-unlock-prompt-from-anacron-task


Comments