Author: dueviti

How to make Unison asks for your ssh passphrase once only.

How to make Unison asks for your ssh passphrase once only.

Unison is a great tool to synchronize files and folders between your systems, but by default it is not bothering storing your ssh private key identities, which can prove annoying if you use a real passphrase – something reasonably long – to protect your key.

This uses ssh-add, ssh-askpass and you must have a running ssh-agent with appropriate environment variables set – usually it is the case by default if your are logged in a graphical X session in most of nowadays Linux distributions.

I added this alias to my ~/.bashrc :

alias unison='ssh-add -l >/dev/null || echo nottypleaseuseaskpass | ssh-add && unison'