Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rsync without SSH access

Firstly, i'm not sure this is the best place to put this question so if it needs moving, thats cool.

I have shared hosting with no SSH access, what are my options in terms of deployment/rsyncing...

I build applications in PHP and use GIT, not sure if this changes things...

like image 963
benhowdle89 Avatar asked Dec 20 '11 12:12

benhowdle89


People also ask

Does rsync always use SSH?

rsync uses ssh as transport by default, but can use any remote shell (with a couple restrictions*), it doesn't care how it connects to a remote server.

Can you use rsync locally?

Rsync is a very useful and widely used tool that can be used to transfer or synchronize files between local and remote servers. Rsync commands are executed through the shell, so an active Linux server is required, as well as an SSH client such as Terminal or PuTTY (for Windows).

Does rsync use SSH keys?

If your remote server employs key-based authentication instead of password-based authentication, then you need to provide the public SSH key in your rsync commands. In this article, we will learn how to use rsync with SSH key.

Can you rsync over SFTP?

You can not run rsync on top of SFTP. You need an rsync server running on the target machine or alternatively a SSH server and the rsync executable there. If you want a command line solution, you can use scp which doesn't rely on rsync protocol.


2 Answers

Rsync legacy versions used rsh as the transport layer, which was replaced by the more secure ssh, you can, however, force it to use other transports with the -e tag (--rsh),

rsync --rsh=rsh

Alternative options,

unison direct socket method (without ssh)

rdiff-backup without ssh (read the REMOTE OPERATION part)

ftpsync

csync rsync-like behaviour over HTTP

like image 162
Joao Figueiredo Avatar answered Oct 23 '22 09:10

Joao Figueiredo


I think that Joao missed the subtlety of working inside a (locked down) shared hosting environment.

However, if you do need to do a proper rsync have you thought about doing an rsync pull from the shared host?

  • I assume that to have some some of DSL router and can resolve its external IP addr.
  • That you can set up port forwarding from an rsync direct socket to your development box.
  • That you can write a simple PHP (or whatever) script which can wrap an rsync request in a proc_open(). (I have a standard command to do this on my shared service)

OK there is a vulnerability here in that the rsync port will be publicly exposed to the internet and the direct socket method doesn't encrypt the payload, but you don't need to use the default and the service only needs to be running during the rsync itself.

I just use a (delta) tarball of any updates and explode locally as part of a release process to my shared hosting account, but rsync is there. It's worth a try anyway.

$ remote rsync --version
rsync  version 3.0.6  protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, no symtimes

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.
like image 20
TerryE Avatar answered Oct 23 '22 10:10

TerryE