There are several ways to transfer files to and from your virtual machine using Secure (or SSH) File Transfer Protocol (SFTP). They all use the following information to create the connection:
- Hostname : the IP address of your virtual machine, for example 126.96.36.199
- Protocol : SFTP using Port : 22
- eRSA username
- eRSA password
FileZilla is one of many programs that provides easy, point-and-click SFTP (secure file transfer protocol). Not only can you easily transfer files between your local computer and your virtual machine (VM), but you can also open and edit documents that are on your VM, using programs on your local computer. You can also use WinSCP, Cyberduck or other sftp clients in a very similar way.
Download and Install FileZilla
- For Ubuntu - Install from the Ubuntu Software Centre app
- Mac and Windows - Download the program file FileZilla
- Double click file - follow installation instructions for Windows
- For Mac - drag the filezilla.app file to your Applications folder.
- Open FileZilla
SFTP connection to the VM
- Open File -> Site Manager .
- Click New Site and give it a name.
- Insert the IP address of the instance as Host
- Logon Type : choos "normal" to save your password for easier connections in future, or "ask for password" for greater security.
- For "User: enter your eRSA username
- Click Connect
The left side of the FileZilla window will list the files of your computer.
The right side will contain the folders and files on the VM.
Navigate to your data storage directory in the right side of the FileZilla screen.
Drag and drop files and directories between your local computer and the VM.
Right click in the file list area to:
- Create a directory or text file
- Edit a text document (you may need to adjust FileZilla/Edit -> Settings/Preferences -> File Editing to ensure documents open in your local computer's default text editor.
- Delete, download or rename files or directories, etc.
2. SCP: secure copy
SCP is a simple method for transferring files between computers.
The basic command for Secure Copy is like a UNIX
cp, but adding a connection to a different computer in the file path
scp <Path_To_Source_File> <Path_to_Destination>
Between a local Mac/Linux and the VM
Enter the command from your local computer's Terminal app.
To upload a file to the VM:
scp <local-file-path> username@ip_address:<VM-file-path>
To download a file from your VM:
scp -i username@ip_address:<VM-file-path> <local-file-path>
Between your VM and a data storage server
If you have data stored on a remote server, you can transfer files between it and the VM through the command-line on the VM.
You will need a host address for the data storage server, and your username, plus usually a password.
scp firstname.lastname@example.org:/data/myDirectory/file.txt /mnt/data/
scp /mnt/data/results.zip email@example.com:/data/myDirectory/
You will usually then be prompted to enter the password for your data storage.
scp -i path/to/key ... if your remote server has ssh keys rather than password access.
3. SFTP via the Command Line
Secure file transfer is also available between the VM and remote data storage.
Enter the 'sftp' command on your VM, and you will have access to the remote host.
sftp firstname.lastname@example.org - you will usually be prompted for a password.
sftp -i path/to/key email@example.com - if the remote server has ssh key authentication
You are now accessing the remote data storage server, and you can navigate the files on the server as per usual with commands like
put will transfer data between the machines:
get <remote_server_file.txt> </mnt/localVM_destination/>
put </mnt/localVM_destination/file.txt> <remote_directory/>
to close the sftp connection, type