View Full Version : unison

22nd November 2011, 05:44 PM

I am trying to use unison on two servers in local network.
IP of Server1
IP of Server2

I have installed unison on booth servers.
I have created private and public SSH key on server 1.
I have copied public key to server 2.

I have set up /root/.unison/default.prf file as follow:
# Roots of the synchronization
root = /var/www
root = ssh://

I have run
unison on server 1, it asked me for password and synchronized everything well.

I wanted to do this process automatic. So I run being in /root/.ssh

ssh-agent bash

ssh-add test where test is name of the SSH key.
It asked me for passphrase of the key and it added to the system.

I have run
unison again and the process started without asking for password. Synchronization worked well.

So I did
crontab -e and added
*/1 * * * * /usr/bin/unison >> /home/test/log.txt 2>&1
and it did not work :)

I went to see log.txt and I have:

Contacting server...
Permission denied, please try again.^M
Permission denied, please try again.^M
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).^M
Fatal error: Lost connection with the server

I have no idea what I am doing wrong. Can you guys suggest something please?

Regards, Tom

23rd November 2011, 04:00 PM

I have noticed that if I add identity to ssh agent, unison does not ask me for password until I type exit.
Any suggestion please?