Yes, Samba can be used to share files between two Linux boxes, but normally it's purpose is to allow Windows boxes to access resources on a Linux box. The more common way to share files between two Linux (or Unix) boxes is with NFS.
Take a look at this link
to see how to setup rsync+ssh. Also, the man page for rsync has examples spread throughout and it lists some important things to pay attention to (slash or no slash at the end of the directory, --delete, etc.)
Another program, lftp
, exists that can perform a similar mirroring function as rsync, but it uses FTP instead. I think rsync is more robust and smarter when it comes to how it transfers the data, but lftp is a very good scriptable ftp program that could be another alternative for you.