PDA

View Full Version : unison



zibrnp
22nd November 2011, 05:44 PM
Hello,

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

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://192.168.1.102//var/www

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
then

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

zibrnp
23rd November 2011, 04:00 PM
Hello,

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?

Tom