# Rsync without password



## jaymax (Sep 27, 2010)

I am using the following in a cron file, to maintain a mirror of a database, at a remote site where I do not have access or control, beyond anon. ftp and rsync. Therefore my machine is only functioning as a client.

```
/usr/local/bin/rsync -avvv --port=33444 ftp.filesource.org::ftp . >> rsynclog
```
I would like to be able to run rsync over ssh which is supposed to be more robust
so I have set up 

```
/usr/local/bin/rsync -avvve ssh --port=33444 ftp.filesource.org::ftp . >> rsynclog
```
which produced output of ==>

```
ssh: connect to host ftp.filesource.org port 22: Operation timed out
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [Receiver=3.0.7]
```

indicating a timeout from ssh

I had followed the instructions for running rsync over ssh without a password, but this was for a Generic UNIX system and probably was not compatible with FreeBSD.
Could anyone say what the correct procedure should be.

Thanks!

P.S. The recommendations I followed was to do the following ---


> Edit /etc/ssh/ssh_config and uncomment the following lines:
> 
> ```
> IdentityFile ~/.ssh/identity
> ...



I should add an expansion: The server does not require a password, probably because it is going through an anonymous mode, but using the '-e ssh' option in the rysnc command, a password is required apparently. 
I added this because there are several solutions on the internet and this forum for passing the password with the rsync command, but they all seem to address the server!


----------



## aragon (Sep 27, 2010)

jaymax said:
			
		

> ```
> ssh: connect to host ftp.filesource.org port 22: Operation timed out
> ```
> 
> ...


Your problem is a network connectivity error.  First steps are to ensure your connectivity to them is working, ensure they're not filtering their SSH port, and ensure they're using port 22 for SSH.


----------



## jaymax (Sep 27, 2010)

(i) I think my connectivity is working based on the logfile of the run without the "-e ssh" option, as evidenced by =>


```
tail -5 rsynclog
recv_files(db/structures/grouped/wxy/i5/wxy2i5x.pub.gz)
db/structures/grouped/wxy/i5/wxy2i5x.pub.gz
recv mapped db/structures/grouped/wxy/i5/wxy2i5x.pub.gz of size 109634
[generator] _exit_cleanup(code=12, file=io.c, line=1530): about to call exit(12)
[receiver] _exit_cleanup(code=19, file=main.c, line=1288): about to call exit(19)
```
But ultimately, this succumbs to a 


```
rsync: read error: Connection reset by peer (54)rsync: writefd_unbuffered failed to write 4092 bytes to socket [generator]: Broken pipe (32)
rsync error: error in rsync protocol data stream (code 12) at io.c(1530) [generator=3.0.7]rsync error: error in rsync protocol data stream 
(code 12) at io.c(760) [receiver=3.0.7]
```

(ii)Now I had read that using the '-e ssh' option produces a more robust connection, hence my inclusion of it in the command. But that lead to the condition described earlier.Well perhaps they could be filtering their ssh port or they are using a different port #. Is there an easy way of checking on this or do I just have to contact their system admin.

Thanks!


----------

