Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unison setup
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
gmport



Joined: Fri Jan 20, 2012 3:16 pm
Posts: 9

PostPosted: Fri Jan 20, 2012 3:28 pm    Post subject: Unison setup Reply with quote

Hi,

I've been using Unison for about 2 years on my installation. This comprised, an HP 6730s laptop and desktop machine, both running Ubuntu 10.04. I synchronise the laptop to the desktop, it's been running perfectly for the whole of that time.

Last week I upgraded both machines to Mint 12 using Gnome 3 with all shell extensions off. Unfortunately, I don't seem to be able to get Unison to connect to the desktop.

On the desktop, I installed SSH with:
“sudo aptitude install openssh-server unison”,

Edited sshd_config:
“PermitRootLogin” from “yes” to “no”.
added line “AllowUser gm”.
Then restarted ssh.

On the laptop, I installed Unison with:
“sudo aptitude install unison unison-gtk”.

I then set-up a profile to test it:
root = /home/gm/Documents
root = ssh://gm@mint-desktop//home/gm/Documents

This is virtually identical to what I've been using on Ubuntu for the last 2 years, apart from the desktop name.

For some reason I can't get this to work, I've been working on it for some time now. Am I missing something? Is there something different about Mint 12? Are there some other settings to be made to sshd_config?

The message I get every time is: “Fatal error, Lost connection with the server”. However, it does work if I try to sync to a local folder. This seems to indicate a problem on the desktop.

Can someone suggest a way of diagnosing the problem?

My mind's not so good these days as I'm getting on a bit, so if someone could possibly advise me I'd be very grateful. I'm running out of ideas.

Regards
gmport
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2353

PostPosted: Fri Jan 20, 2012 3:33 pm    Post subject: Reply with quote

You assign 'root' twice: first as local, then as a remote directory. This may cause confusion. Perhaps I'm wrong, as I have no knowledge of Unison Razz
Back to top
View user's profile Send private message
gmport



Joined: Fri Jan 20, 2012 3:16 pm
Posts: 9

PostPosted: Fri Jan 20, 2012 3:44 pm    Post subject: Reply with quote

Thanks for your reply Dutch_Master,

Two roots are necessary in unison, as you say: one local and one remote.

Regards
gmport
Back to top
View user's profile Send private message
Bruno
LXF regular


Joined: Tue Sep 18, 2007 7:07 pm
Posts: 139
Location: Cambridgeshire, UK

PostPosted: Fri Jan 20, 2012 6:04 pm    Post subject: Reply with quote

Hi gmport,

Just looking at your second, remote root: I think it should read:
Code:
ssh://gm@mint-desktop/Documents

rather than what you have given in your original post.

As you have specified the user that connects to the server in the second root path, I think you automatically get sent to that user's directory within the /home folder on the server.

So the syntax is:
Code:
ssh://<user>@<server>/<path to file or folder as if starting from ~/ at the prompt>


I hope this helps.
Back to top
View user's profile Send private message
nelz
Moderator


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8002
Location: Warrington, UK

PostPosted: Fri Jan 20, 2012 10:44 pm    Post subject: Reply with quote

The first thing to check is whether you can connect to the remote computer with SSH. The lost connection error could be caused by an SSH login failure.

If that's not the problem, look in ~/unison.log for more clues.
_________________
Unix is user-friendly. It's just very selective about who it's friends are.
Back to top
View user's profile Send private message
gmport



Joined: Fri Jan 20, 2012 3:16 pm
Posts: 9

PostPosted: Sat Jan 21, 2012 1:48 pm    Post subject: Unison setup Reply with quote

Thank you for your replies Bruno and Nelz,

I have tried your suggestion Bruno, unfortunately without success. I just get the same error message “Fatal error – Lost contact with server”.

However, I went to the Unison site at: http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html

and found a manual, It's for version 2.40.61 and I'm using 2.32.52, so I hope it's still relevant. The manual has instructions for testing the connection by typing: "ssh remotehostname unison -version" on the client (which I asume to be my laptop – Unison is installed on the laptop?).

The response is: "ssh: could not resolve hostname mint-desktop: Name or service not known".

On both machines "unison -version" responds with: 2.32.52"
and "ssh -V" with: "OpenSSH_5.8pl Debian-7ubuntul, OpenSSL 1.0.0e sep 2011"

I think you may be right Nelz, it's an SSH login failure. I can't find any clues in the log file.

Could you tell me how to get started finding a problem in ssh.

Regards
gmport
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2353

PostPosted: Sat Jan 21, 2012 2:26 pm    Post subject: Reply with quote

The fact that ssh responds when asked for its version number indicates that 1) it's installed and 2) it's running. That only leaves a connection error. By default, ssh runs on port 22 and you may have a mis-match in the config file or, more commonly, a firewall blocks access to port 22. Another common issue is exchanging the public keys: your previous setup may have done that by itself, but this one hasn't. You need to generate public and private keys and copy the public key to the other machine's trusted_hosts file in the ~/.ssh/ directory.
Back to top
View user's profile Send private message
gmport



Joined: Fri Jan 20, 2012 3:16 pm
Posts: 9

PostPosted: Sat Jan 21, 2012 3:41 pm    Post subject: Unison setup Reply with quote

Thank you Dutch_Master,

I'm reading up how to generate and save the keys. The instructions say to save the keys on the local machine to “/home/username/.ssh/”. I don't have a hidden ssh directory on either machine. Should I already have one or should I create it?

Also, it says that the RSA key pair must be copied to the remote system with: “ssh-copy-id -i ~/.ssh/linuxlookup_rsa.pub username@example.com”. But my ssh connection is not yet working, can I just copy them 'manually' to the remote .ssh directory.

Forgive my caution, I have already had to re-install both machines after trying to do something similar that I wasn't sure how to do correctly.

Regards
gmport
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2353

PostPosted: Sat Jan 21, 2012 4:05 pm    Post subject: Reply with quote

Are you checking the right directory? You have 2 users (that I'm aware of, there are in fact many more on your system, but no need for alarm), namely your own user (the account you log in to) and the unison user. As I understand from your earlier messages, Unison runs as the unison user, so you'd need to look in the /home/unison/ directory. However, it doesn't hurt to copy these keys to your normal user account too. If you're unsure, copy them via USB stick.

Here's another clue, overlooked first time round:
Code:
ssh: could not resolve hostname mint-desktop: Name or service not known
This means ssh has no idea what IP address belongs to the hostname 'mint-desktop'. Open the file /etc/hosts with a text editor, as root, and add the IP address of the machine with its name.
Back to top
View user's profile Send private message
gmport



Joined: Fri Jan 20, 2012 3:16 pm
Posts: 9

PostPosted: Sat Jan 21, 2012 4:26 pm    Post subject: Unison setup Reply with quote

Hi Dutch_Master and thank you for your patience.

I opened the file /etc/hosts as you suggested but there doesn't seem to be an entry for "mint-desktop" see below:

127.0.0.1 localhost
127.0.1.1 6730s

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.0.1 must be my wireless router.

Sorry if I said something confusing earlier, but Unison is not setup as a user.

Regards
gmport
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2353

PostPosted: Sat Jan 21, 2012 4:46 pm    Post subject: Reply with quote

No, 127.0.0.1 is the loopback address. Basically, it's a way for the machine to connect to itself. What you need to do is to add the following to this file:
Code:
192.168.1.20 mint-desktop

That is, assuming 192.168.1.20 is the actual IP address of that machine. If not, adjust accordingly. If you don't know the IP of that machine, find it with
Code:
ifconfig eth0
on mint-desktop itself, or use nmap to scan your network to find it.

As for the unison user: I may have misunderstood your message though, as stated earlier I know next to nothing of that tool Embarassed
Back to top
View user's profile Send private message
Bruno
LXF regular


Joined: Tue Sep 18, 2007 7:07 pm
Posts: 139
Location: Cambridgeshire, UK

PostPosted: Sat Jan 21, 2012 5:13 pm    Post subject: Reply with quote

Hi All,

Unison is now only under occasional development but bug reports, feature requests and questions are still being taken by its original developers. For more, see here. Therefore, in this case; the difference between the version numbers of your installed packages and obtained documentation should not make much difference. However, it is best to either update your packages to 2.40.61 or find the documentation for 2.32.52. When you installed unison, the package should have contained documentation, too. On my system, it is located at /usr/share/doc/packages/unison/unison-manual.html, so try there on your system or consult the file list of the package you installed if it is not there. FYI, I'm using version 2.32.52 without problems on openSUSE 11.4.

OK, as nelz says, the first thing to do is check that sshd (the ssh daemon) is running on your remote/server computer. On your server, copy and paste the following into a new, plain text file and call it something like "sshd-run-checker.sh":
Code:
#!/bin/sh
check_stat=`ps -ef | grep sshd | grep -v grep | awk '{print $2}'`
if [ -n "$check_stat" ]
then
  echo "SSHD is running"
else
  echo "SSHD isn't running"
fi
Now open a terminal session, navigate to the directory in which you have just created the file and type the following:
Code:
sh sshd-run-checker.sh
A message should appear in the terminal telling you if sshd is running or not. I'll assume here that it is or that you know what to do if it isn't. If it isn't and you don't, just reply and we'll take it from there.

Next, as you spoke of version numbers, we should make sure you are using the same version of unison on each computer. Please type the following at the terminal on each computer:
Code:
unison -version
and compare the results. Are both versions the same?

Next, we need to check that your local/client computer can find or resolve your remote/server computer. Try logging onto your server from your client by ssh by typing the follwing at the terminal:
Code:
ssh gm@mint-desktop
Do you get logged in (or prompted for your password) or do you get an error message containing a phrase like "No route to host"? BTW, are you using a password or a public/private key method for authentication? If you get the "No route to host" error message, you need a config file somewhere to tell your client system the ip address on your local network to associate with the host "mint-desktop". If you are using keys, this is done by placing a plain text file called "config" in the folder /home/gm/.ssh/. The file should contain the following text:
Code:
Host mint-desktop
      Hostname 192.168.x.x
The ip address will be particular to your own set-up, but I'm assuming you are using addresses in that range, just complete the file using the address of your server. For password authentication, I'm not sure where to put the config file.

I hope all this helps. If you are a subscriber, there are a few articles covering unison and ssh in previous issues which may also be of help to you.
Back to top
View user's profile Send private message
gmport



Joined: Fri Jan 20, 2012 3:16 pm
Posts: 9

PostPosted: Sat Jan 21, 2012 5:25 pm    Post subject: Unison setup Reply with quote

Dutch_Master... I am so grateful adding "192.168.1.2 mint-desktop" to "/etc/hosts" fixed the problem. I can now connect to the remote PC.

Thank you for your patience.

Very best regards
gmport
Back to top
View user's profile Send private message
gmport



Joined: Fri Jan 20, 2012 3:16 pm
Posts: 9

PostPosted: Sat Jan 21, 2012 5:34 pm    Post subject: Unison setup Reply with quote

Hi Bruno,

Thank you for the information, I don't pretend to understand it all but I shall certainly save it for future reference.

Thank you and thanks to everyone that replied to my request for help.

Best regards
gmport
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2353

PostPosted: Sat Jan 21, 2012 10:49 pm    Post subject: Reply with quote

Most welcome, that's what this forum is all about: sharing knowledge and trying to assist in solving problems if and when they arise Smile
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast