View previous topic :: View next topic |
Author |
Message |
grant123 Veteran
Joined: 23 Mar 2005 Posts: 1080
|
Posted: Wed Jan 20, 2016 1:41 am Post subject: Rsync through router without router config |
|
|
Can I rsync to a system that is behind a router without configuring the router? Maybe if I have the system I want to rsync to make itself available to me somehow? |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21622
|
Posted: Wed Jan 20, 2016 2:31 am Post subject: |
|
|
You can use as an rsync server any machine to which you can connect over an rsync transport. Typical consumer routers will by default drop connection requests coming from the Internet. |
|
Back to top |
|
|
grant123 Veteran
Joined: 23 Mar 2005 Posts: 1080
|
Posted: Wed Jan 20, 2016 1:44 pm Post subject: |
|
|
I'm giving a laptop to a non-technical person and I want to be able to rsync to it periodically. I could try to explain to them how to configure their router but I'm wondering if there is a way around that. Any creative solutions? Can I have the laptop connect to a server on the internet which will hand off the rsync connection for me? |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
grant123 Veteran
Joined: 23 Mar 2005 Posts: 1080
|
Posted: Wed Jan 20, 2016 11:26 pm Post subject: |
|
|
Thanks Uberlord. It seems like OpenVPN would be a lot of trouble for this. Any other options? |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Thu Jan 21, 2016 4:08 am Post subject: |
|
|
OpenVPN is quite easy to configure at both ends. And is pretty much guaranteed to work.
Of course, you could employ another brand of VPN.
The other option, as you say, is configuring their router.
This has it's own set of problems
* Can the router port forward to start with?
* What if someone else wants the port (a rsync server belongs to spouse?)
* Do it again when router is swapped out
* Do it again if laptop moves out
* Laptop could be on business trips a lot - i don't know if you need to rsync at these times.
I'm sure there are more reasons, but frankly installing some kind of VPN end point is your best option for less hassle later. _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Thu Jan 21, 2016 6:07 am Post subject: |
|
|
IPv6 would be a good option - but if you're stuck with the kind of router that causes this problem, it probably doesn't support that at all. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Thu Jan 21, 2016 12:03 pm Post subject: |
|
|
you may also just tunnel rsync with ssh, and then just need a valid ssh access already set behind your router. |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Thu Jan 21, 2016 12:37 pm Post subject: |
|
|
Yeah rsync over ssh is lovely; we use it on the LAN as well, in addition to ssh-fs for things like distfiles.
#openssh is the best place to get incisive advice from professionals using it, ime.
Though you'd also get a good deal of help on rsync in #bash
Both on IRC: chat.freenode.net or .org |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
grant123 Veteran
Joined: 23 Mar 2005 Posts: 1080
|
Posted: Thu Jan 21, 2016 5:27 pm Post subject: |
|
|
Could I have the laptop automatically connect to my server via SSH after prompting the desktop user for credentials? Then the SSH connection would be up all the time and I could rsync to the laptop that way. |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3134
|
Posted: Thu Jan 21, 2016 5:36 pm Post subject: |
|
|
Quote: | Can I rsync to a system that is behind a router without configuring the router? Maybe if I have the system I want to rsync to make itself available to me somehow |
Does the direction (to a system behind a router - with a NAT by default) refer to data transfer or initiating a session?
If it's the latter, it can be done, but it's tricky. As already said, it requires port redirection and you basically don't want to do that with any router you don't hold with your hand (so you need a vpn)
If it's the former... Yes, you can. Just open the session from behind the NAT and pull the data. Most likely you will not even notice that NAT on your way. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Thu Jan 21, 2016 5:54 pm Post subject: |
|
|
grant123 wrote: | Could I have the laptop automatically connect to my server via SSH after prompting the desktop user for credentials? Then the SSH connection would be up all the time and I could rsync to the laptop that way. |
If you can do that, just get the laptop to rsync push or pull to you.
This avoids ssh which would prompt for a passord.
This avoids any router or VPN changes.
This could also be put into a cron job to happen at set times. _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Thu Jan 21, 2016 9:41 pm Post subject: |
|
|
UberLord wrote: | Surely rsync over ssh tunnel requires the *same* router modifications as the rsync straight to the laptop - the router needs to port forward to the laptop. |
Makes sense.
Quote: | The problems with this approach I listed above and still apply.
Unless I'm missing something mind-numbingly obvious... |
Nah, I wasn't really paying attention to the topic, my bad; I just noticed krinn's nick and the bit about rsync over ssh, and wanted to add a vote of confidence.
Though ssh is often set-up already, as krinn pointed out. If not, it's one of the first things you want to set up, and thereafter rsync (or anything else, including X) isn't such an issue. |
|
Back to top |
|
|
grant123 Veteran
Joined: 23 Mar 2005 Posts: 1080
|
Posted: Fri Jan 22, 2016 12:12 am Post subject: |
|
|
The way my maintenance script works, I need to be able to rsync push to the laptop. Can I have SSH automatically connect so I can rsync push through that connection to the laptop, but for security not give the laptop a real shell on the system it's connecting to? |
|
Back to top |
|
|
1clue Advocate
Joined: 05 Feb 2006 Posts: 2569
|
Posted: Fri Jan 22, 2016 2:10 am Post subject: |
|
|
You could add a point for your rsync, so there's something outside the firewall. Something that works like dropbox.com. |
|
Back to top |
|
|
grant123 Veteran
Joined: 23 Mar 2005 Posts: 1080
|
Posted: Fri Jan 22, 2016 2:15 am Post subject: |
|
|
1clue, yes, what is available like that? |
|
Back to top |
|
|
1clue Advocate
Joined: 05 Feb 2006 Posts: 2569
|
Posted: Fri Jan 22, 2016 2:23 am Post subject: |
|
|
you could use any cloud storage and rsync, or you could use dropbox. Dropbox for Linux is basically a web page, not sure I'd recommend that for what you're talking about.
You could also go get a minimal box on linode.com for example, and do a true rsync since that's a linux box.
Sorry I don't have a lot of solutions for you, I've never needed to do this sort of thing.
Come to think of it though, what sort of files are you talking about? Have you considered a git repository?
Personally my solution would be to install that vpn. You didn't like that, I'm just trying to figure out something else that might work.
Disclaimer: I am very suspicious of cloud storage, especially any service you get for free. If you get a service for free on the Internet, you are not the customer. You're the product. |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Fri Jan 22, 2016 12:19 pm Post subject: |
|
|
UberLord wrote: | If you can do that, just get the laptop to rsync push or pull to you.
This avoids ssh which would prompt for a passord. |
you can setup a passwordless ssh access, it's his laptop, he can easy create and known the public key to use for that, and setup all accesses need for that.
ssh offer more flexibility, as you can do a cron job with ssh querying if any action should be done or not by checking files presence (just like fsck do with /fastboot)
#/bin/bash
cmd=$(ssh user@desktop ls /tmp/runwithssh-*)
// and a list of if cmd == runwithssh-rsync -> rsync or runwithssh-reboot -> shutdown -r 1...
now you can check what files are there and execute the wanted commands from the laptop, allowing the desktop to instruct the laptop to do prebuild commands without accessing it as it's the laptop that access the desktop (and no router issue so) and check if it need to run something or not.
ps: you could create a /tmp/runwithssh-autoupdate that would scp the file with all ssh commands to execute from the desktop, allowing the laptop to download the new version of the script with new commands in it you had forget to put before you gave the laptop.
this way, laptop is not limited to only use rsync and router is never a problem as it's the laptop that do the connection with his desktop. |
|
Back to top |
|
|
1clue Advocate
Joined: 05 Feb 2006 Posts: 2569
|
Posted: Fri Jan 22, 2016 5:18 pm Post subject: |
|
|
Laptops being notoriously off and on all the time, an rsync would make more sense if it were initiated from the laptop anyway. |
|
Back to top |
|
|
|