Segui

How to copy a file to/from an Endian Appliance

Applies to platform: all
Last updated: 4th July 2012

It is sometimes useful to be able to copy files from or to your Endian UTM Appliance especially if you do not have direct access to it or when you need to transfer large files: In other word, whenever the use of a USB stick or similar devices is not feasible. The only requirement to copy a file from or to your Endian UTM Appliance is to enable SSH access, under Menubar > System > SSH Access.

The Endian UTM Appliance ships with three command line tools that allow to copy files to external systems:

  1. scp, supporting the secure Copy Protocol (SCP)
  2. sftp, supporting the SSH File Transfer Protocol (SFTP)
  3. rsync, a more sophisticated tool on which several back-up systems are based, based on the efficient xdelta algorithm.

These tools are also installed by default -or available though- on most Linux and MacOSX systems, on which they are also well documented. For Windows platforms there exist several software applications that you can freely download and install. We will use WinSCP, available under the GPL license at http://www.winscp.net/ as reference in this lesson.

Linux and Mac OS X users

The use of scp or rsync is very similar:

root@endian:~# scp localfile user@remote:/path/to/remote/file
root@endian:~# rsync localfile user@remote:/path/to/remote/dir

The abovementioned commands are almost self-explanatory:

  • localfile is the name of the file on the local computer (can also be a directory, many files, or many directories), possibly with the path
  • user@remote the user and hostname (or IP address) of the computer to which the file should be copied
  • /path/to/remote/dir is the full path to the directory under which the file to be copied will be stored

You can simply switch localfile and user@remote:/path/to/remote/file to copy a remote file to the local computer, so it really does not matter on which computer you start the copy.

Example: to copy the backup file of your Endian UTM Appliance on your local Linux box, you can issue the following command:

user@linux:~# scp -P 22 root@10.7.5.135:/var/backups/backup-20110916012855-host-x1s75op2a6.localdomain-settings-db-logs-logarchive.tar.gz .
root@10.7.5.135's password:
backup-20110916012855-host-x1s75op2a6.localdomain-settings-db-logs-logarchive.tar.gz   100%   16MB   2.0MB/s   00:08

You need to enter the root password. The -P option allows to specify a port different from the standard one (22).

Note

You can speed up the whole process of copying file remotely by using SSH keys, so you do not need to supply the remote passowrd at each copy.

The use of sftp is a bit different. You first connect to the remote computer to open a shell on it (assuming to connect from our workstation to a remote Endian UTM Appliance):

user@linux:~# sftp user@remote

To operate on the remote filesystem, use the normal shell commands (cd, ls). to operate on the local filesystem, you can use the same commands, prefixed by 'l', i.e., lcd and lls. To copy files from the local to the remote directory, simple use

root@endian:~# put localfile

while to copy a file from the remote directory, use

root@endian:~# get localfile

Microsoft Windows users

?name=media_1334934366406.png

After having downloaded WinSCP from http://winscp.net/eng/download.php#download2, install it and launch it.

In the main Window you can provide all the necessary data to access the Endian UTM Appliance:

  1. The GREENIP Address or the hostname of your Endian UTM Appliance
  2. Leave 22 as the port number
  3. Use root as username
  4. Type the root password
  5. Select SCP of SFTP as Protocol

Click on the Login button. When the connection is established, you will be asked to accept the remotes host key. Select Yes

?name=media_1334935152495.png

If the connection is successful, a new window will open that shows the local directory on the left (1) and the remote directory (2) on the right. You can freely copy files between the two directories, like they were on the same computer and use the interface like the Windows Explorer, browsing directories, renaming or deleting files, and so on.

Altre domande? Invia una richiesta

Commenti