rsync

 

Using rsync (BETA) with SmartFile

SmartFile supports rsync over SSH. This feature is currently considered beta, and is subject to changes. This method of using rsync uses an SSH tunnel for communication. Once communication is established, the local rsync instance communicates with a remote instance using the rsync protocol.

The SmartFile SSH server only allows the SFTP subsystem and rsync to be requested. Any other access (such as shell requests) will be denied.

== Password Authentication ==

This is the default authentication method. When connecting via SSH, if key authentication is not set up the user will be prompted for a password.

== Key Authentication ==

In order to use key authentication, the user must generate a key pair. On the client machine, issuing the following command will generate a new SSH key pair.

# ssh-keygen

By default, the key pair will be stored in $HOME/.ssh/id_rsa and $HOME/.ssh/id_rsa.pub.

The public key (id_rsa.pub) must be loaded into a specific directory within SmartFile for the authentication to work. SmartFile expects the id_rsa.pub file to be stored as .ssh/username.pub. The .ssh directory must be relative to the user's home directory. For example, if the user's home directory is /home/steve, then the full path to steve's authorized keys file would be /home/steve/.ssh/steve.pub.

1. Log into the SmartFile web UI or FTP and create a directory named .ssh.
2. Upload the id_rsa.pub file into this new directory.
3. Rename the id_rsa.pub file to <username>.pub. <username> should be replaced with the username of the user which will authenticate using this key.

Additional keys can be placed into this file. Each key should occupy a single line. Any public keys located here will allow the corresponding private key to authenticate as the user. If multiple users share a home directory, their keys will reside in separate files in the same .ssh directory.

== Paths ==

All paths on the server (SmartFile) are relative to the user's home directory. Therefore, the following command...

# rsync -avr /home/steve/Music steve@app.smartfile.com:/Music

Will synchronize the local directory /home/steve/Music to a directory named Music in steve's home directory within SmartFile.

Symlinks are required to point to targets within the user's home directory. Any symlink pointing outside the user's home directory will be ignored.

== Permissions ==

Because permission checks cannot be done within the rsync program itself
SmartFile performs a permission check before spawning the rsync program
on the server.

The user initiating the rsync transfer must have specific permissions
for every directory and file within the requested server directory. If
the user lacks the given permission, rsync will be aborted with an error
message.

For rsync sessions TO SmartFile (uploads), the required permissions are: UPLOAD, CREATE, and LIST.

For rsync sessions FROM SmartFile (downloads), the required permissions are: DOWNLOAD and LIST.

Additionally, for an rsync upload, where the --delete option is present, the DELETE permission is also required.

== Quotas ==

The user and site quota are checked before executing rsync.

If a disk quota has been exceeded, rsync uploads are not allowed, however downloads are allowed to proceed.

If a transfer quota has been exceeded, no rsync requests are allowed.

== Conclusion ==

The bulk of rsync is supported and most of the documentation found on the Internet regarding rsync and SSH will apply to using rsync with SmartFile.