Destinations‎ > ‎

SSH

The ssh & sftp destinations transfer files to a ssh server.  Public/private key certificates must be setup on the ssh server so that the userid running HashBackup can connect to the server without a userid or password.  For more information about how to setup keys, search the web for "passwordless ssh".


ssh vs sftp Destination Type


If the destination type is sftp, only the local sftp command is used to connect to the remote server.  This has 2 limitations: a) selective download (downloading part of a remote file) is not supported; b) upload rate limiting is not supported since the sftp command does not support this.


If the destination type is ssh, the local ssh, sftp, and scp commands are used for remote operations, and the dd command is used on the remote server.  Selective download is supported when type is ssh, allowing a much more efficient use of download bandwidth when restoring smaller amounts of data, especially if large arc files are used.  Also, the rate keyword is supported with ssh destinations to limit upload bandwidth.


To debug sftp destination problems, make sure sftp works from the command line first, without needing a password.  After starting sftp under the same userid HB will be using, try the cd, mkdir, ls -l, get, rm, rename, and put commands.  If they all work, HashBackup should work.  mkdir is only used when cd fails, usually because the dir directory doesn't exist.


To debug ssh destination problems, make sure you can ssh to the remote server without a password, test that sftp works as above, and that scp can be used to upload files.


dest.conf keywords


type (required)


Either ssh or sftp


userid


Optional, defaults to the userid running hb


port


Optional defaults to 22


dir


Files are normally created in the initial login directory on the ssh server.  To create multiple backups using the same ssh credentials, the dir keyword can be used and its value will be prepended to all filenames.  


The directory will be created on the ssh server if it doesn't already exist, but sftp can only create simple subdirectories.  Anything more complex needs to be created before running HB.


debug


Optional, higher integer values display more debug messages.


args


This optional keyword allows passing ssh options to the sftp program.  For available options, see man ssh_config.  The example below uses an alternate private key file and enables extra debug messages.  If there are spaces in any option values, quote the value as you would on the command line.


destname myssh

type ssh

userid jim

host xyz.myserver.com

port 22

dir mybackupdir

debug 2

args -oIdentityFile=~/.ssh/otherid -oLogLevel=debug

Comments