Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a desktop at home, and a laptop that I take with me to places away from home, both have Fedora 20 installed. I edit the same files on either machine, and would like to be able to synchronise these files over the Internet to keep them identical, and avoid the error prone task of trying to repeat the same edits on the other one. It seems that using unison and ssh are the way to go, (but if there is a more straightforward method, I would be happy to use that instead, not diff and patch though) but what I have failed to discover is how to find out the identification details as in this extract from a document on how to use unison:

$ unison -testServer /home/ravisaive/Desktop ssh://172.16.25.125//home/ravisaive/Desktop

The document is: Unison – An Ultimate Local/Remote File Synchronization Tool for Linux By Avishek Kumar Under: Backups On: March 21, 2014

So my question is, please: how do I obtain or define the equivalents of the 172.16.25.125 for my two machines? In other "how to do it" articles I see plink@plonk as the form of the identifiers, is this easier, and again how do I discover or define them?

Please, I would like an answer that is suitable for my completely novice status on this topic, not the sort that only experts can understand. Please insult my intelligence.


A Final plea:

I have asked similar questions to this on the Internet and here, and cannot get an answer to what seems to me to be a straightforward question. Here is another quotation, about OpenSSH (From Fedora Wiki, SSH)

"The Default fedora setup for the ssh client works just fine for a basic ssh server setup, like the one above. The syntax is even pretty basic, command options username @ address or IP. An example follows.

ssh user@192.168.1.100 "

In my slow dim-witted way I just cannot see where the "user@192.168.1.100" comes from. Perhaps it is so obvious that I shouldn't need to ask, but I can't see it for myself. Please can someone explain this for me?

share|improve this question
1  
I use SparkleShare to sync directories across systems. It's a complete solution, requiring only SSH access to a centralized server. sparkleshare.org. If this is of interest to you I can write it up as an A. But just want to make sure you're open to it first. –  slm Jun 2 at 18:44
1  
This really seems to be about setting up your home machine to be an ssh server accessible outside you home network. Once you have that set up you will know what 172.16.25.125 refers to. –  StrongBad Jun 2 at 19:49
    
@sim, thank you for the suggestion of sparkleshare. I will look into it a bit to see if I should take up your kind offer. –  Harry Weston Jun 2 at 22:12
1  
I would also suggest that as you seem to be talking about text files you're editing, that a version control system (e.g., git) will help keep them in sync and also give you full history, etc. –  derobert Jun 3 at 16:39

1 Answer 1

up vote 1 down vote accepted

user@host is how SSH defines who it attempts to authenticate as (user) and where it should do that (host)

The user

This can be any local user account on the desktop and/or laptop you are connecting to. This user will need to be able to login to that machine via ssh and have full permissions to all the directories you are trying to sync.

You can view the current users available on your box in or the gui or cat /etc/passwd in a terminal.

You may want to add a user to Fedora specifically for your unison. Maybe sync?.

You will probably want to set up SSH key's between the two boxes.

The host

The host is the IP address or hostname component of the connection. In your case this will be the public IP of your desktop or laptop. Most likely your desktop as that will probably be more stable than your laptop IP which will roam around depending on where you are connected.

To find the current public IP of your laptop or desktop:

curl -s http://wtfismyip.com/text

This IP address will probably change over time, depending on your ISP, which can be a bit of a pain. You can get a dynamic DNS name from someone like NoIP to get around this. The ssh connection would become something like sync@whatver.no-ip.org and the DNS name whatver.no-ip.org will resolve to whatever machine is running the NoIP client.

You will most likely have a NAT router at home for your internet connection that you will need to port forward ssh through (TCP port 22) for all this to work.

Note

By the way, unless you really want to figure this out, it might be easier using one of the standard file hosts like Dropbox who provide a linux client or Google Drive via insync or gdfuse. They do all the hosting then, you just run the client that sits in the background and syncs.

share|improve this answer
    
A very useful summary, @mtm. Thank you (and everyone who responded). I have signed on with No-IP and will see how it goes from there. With luck that is the major hurdle overcome. I like the idea of ssh and unison, and will continue on that path, but I do appreciate the other suggestions. –  Harry Weston Jun 3 at 19:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.