File Transfer to and from Your VM

File transfer is a common task when working with a remote server. We will use the sftp (secure file transfer protocol) to transfer files. We can use this at the command line, or with a graphical user interface (GUI). We will cover both methods here. I usually use the command line method, but I know that some people prefer a GUI.

Command Line Method

Windows

On a Windows computer, for the most Linux-like experience use git-bash, or you can install the Windows Subsystem for Linux (WSL). It is also possible to use PowerShell but I am not familiar with that method. git-bash is installed on the lab computers, so you can use that if you are working in the lab.

Mac or Linux

On a Mac or Linux computer, you can use the terminal.

getting started with sftp

open one of the above terminal applications. Use cd to navigate to the directory where you want to transfer files. Then use the following command to connect to your VM:

sftp username@vm-ip-address

For the VM the username is exouser. The IP address can be found in the original Slack message about your VM.

You will be prompted to enter your password. Once you are connected, you can use cd and ls to navigate directories and list files on the VM, and the following commands to transfer files:

  • put local-file to transfer a file from your local computer to the VM
  • get remote-file to transfer a file from the VM to your local computer
  • mput local-files to transfer multiple files from your local computer to the VM (use wildcards like * to specify multiple files)
  • mget remote-files to transfer multiple files from the VM to your local computer (use wildcards like * to specify multiple files)

When you are done, use the exit command to disconnect from the VM.

GUI Method

Lab computers: WinSCP

Start the WinSCP application. In the login window, enter the following information:

  • File protocol: SFTP
  • Host name: vm-ip-address (can be found in the original Slack message about your VM)
  • Port number: 22
  • User name: exouser
  • Password: (the password for your VM)
  • click “Login”. You will see a split window with your local files on the left and the VM files on the right. You can navigate to the desired directories and drag and drop files between the two sides to transfer them.

Mac or other personal computers: FileZilla

A similar program for Mac or other personal computers is FileZilla. The setup is similar to WinSCP, but the interface is a little different. You can download FileZilla from here (you want the “client” version). Once you have it installed, open the application and enter the following information in the “Host”, “Username”, “Password”, and “Port” fields at the top of the window:

  • Host: vm-ip-address (can be found in the original Slack message about your VM)
  • Username: exouser
  • Password: (the password for your VM)
  • Port: 22

Then click “Quickconnect”. You will see a split window with your local files on the left and the VM files on the right. You can navigate to the desired directories and drag and drop files between the two sides to transfer them.