3

I am trying to set up Unison and am testing the connection. I run this command from the documentation:

unison /var/www ssh://192.168.1.102//var/www

but it tries to log into the remote server using my local machine's username. I've tried several things, but nothing works. I've tried adding username@ssh... and also searched for flags to use, but found none.

3 Answers 3

4

You could create a config file for ssh(~/.ssh/config) with the content

Host UnisonHost
    HostName 192.168.1.102
    User username

and then call unison with UnisonHost:

unison /var/www ssh://UnisonHost/var/www
0
1

User JRC's answer is almost correct. I'll just add a few details. Your command should be

unison /var/www ssh://[email protected]//var/www

or if you create a Unison profile in ~/.unison/ (which you should), it should contain the lines

root /var/www
root ssh://[email protected]//var/www
0

I'm not familiar with unison's syntax, but usually SSH addresses are written like

[username]@[host]:[uri]

Or in your case,

[email protected]:/var/www

Try that, to see if it works does the job. Don't include the 'ssh://' in front.

1
  • I tried that, but for Unison, you can't put username@ before the host. It has to read ssh://host
    – pekasus
    Commented May 1, 2016 at 12:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .