Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Rsync through router without router config
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 980

PostPosted: Wed Jan 20, 2016 1:41 am    Post subject: Rsync through router without router config Reply with 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?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13493

PostPosted: Wed Jan 20, 2016 2:31 am    Post subject: Reply with quote

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
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 980

PostPosted: Wed Jan 20, 2016 1:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Wed Jan 20, 2016 9:58 pm    Post subject: Reply with quote

Sounds like you need a VPN.open VPN is quite good for this.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 980

PostPosted: Wed Jan 20, 2016 11:26 pm    Post subject: Reply with quote

Thanks Uberlord. It seems like OpenVPN would be a lot of trouble for this. Any other options?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Thu Jan 21, 2016 4:08 am    Post subject: Reply with quote

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
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5589

PostPosted: Thu Jan 21, 2016 6:07 am    Post subject: Reply with quote

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
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Thu Jan 21, 2016 11:49 am    Post subject: Reply with quote

Ant P. wrote:
IPv6 would be a good option


I didn't mention that because there's no guarantee the laptop will be used in an IPv6 environment.
In the UK at least you have to goto a small ISP to get IPv6 as none of the big ones offer it.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6962

PostPosted: Thu Jan 21, 2016 12:03 pm    Post subject: Reply with quote

you may also just tunnel rsync with ssh, and then just need a valid ssh access already set behind your router.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Thu Jan 21, 2016 12:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Thu Jan 21, 2016 1:12 pm    Post subject: Reply with quote

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.
The problems with this approach I listed above and still apply.
Unless I'm missing something mind-numbingly obvious...
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 980

PostPosted: Thu Jan 21, 2016 5:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1717

PostPosted: Thu Jan 21, 2016 5:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Thu Jan 21, 2016 5:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Thu Jan 21, 2016 9:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 980

PostPosted: Fri Jan 22, 2016 12:12 am    Post subject: Reply with quote

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
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2514

PostPosted: Fri Jan 22, 2016 2:10 am    Post subject: Reply with quote

You could add a point for your rsync, so there's something outside the firewall. Something that works like dropbox.com.
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 980

PostPosted: Fri Jan 22, 2016 2:15 am    Post subject: Reply with quote

1clue, yes, what is available like that?
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2514

PostPosted: Fri Jan 22, 2016 2:23 am    Post subject: Reply with quote

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
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6962

PostPosted: Fri Jan 22, 2016 12:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2514

PostPosted: Fri Jan 22, 2016 5:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
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