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...
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.
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).
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.
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.
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
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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With