I’ve been a Godaddy client for 10 years. I started this blog in 2006. Back then Godaddy didn’t provide an ssh shell login. So needless to say that they’ve come a long way trusting their users. They’re pretty tight about how much they let their user do on share hosting. However, now a days, users with share hosting have bash, python, php right at the shell login. And it makes it much easier for savy user and Infotech professionals to get their job done. But one of the drawbacks that I find is the fact that many times I try to sync my local work directory with the remote work directory located in my godaddy account using rsync, and I can’t. And that is because godaddy doesn’t provide rsync for their share hosting users. Therefore, I’m writing this workaround which you can use to get around using rsync to sync your work between godaddy and your localhost.
1 – you need to create a passwordless login with your godaddy remote host. In other words you need to setup a public and private key, and copy your public key to your remote host, so you can login without getting prompted for password. I wrote this article that explains how to do that.
2 – Install sshfs in your local system, if not installed.
sudo apt-get install -y sshfs
this will allow you to mount a remote directory on your localhost
3 – Next, create a mount point. I chose to create a directory within my home directory. I called it godaddy.
4 – Mount the remote directory using sshfs
sshfs email@example.com: godaddy/
the colon ‘:’ after the remote hostname will mount your home directory on the remote host. If you which to mount a especific direcotry within your home directory in the remote host. Then add it after the colon eg: firstname.lastname@example.org:dir1.
5 – Finally, synchronize your directory with rsync.
rsync -avzP work/ godaddy/work
This will sync your local work directory to remote. So in order to sync your remote work directory to local, just change the order of directories eg: godaddy/work/ work.