Transfer Files to and From CSE Machines

This article covers information on different ways to remotely transfer files between your computer and CSE Machines.

Secure Copy (SCP)

SCP uses secure shell encryption to transfer files from one computer to the other. This protects your username and password along with the files you are transferring from outside interception. 

Copy a File From a CSE Machine to Your Computer

  1. Connect to VPN.
  2. Open Terminal (Mac and Linux) or the Command Prompt (Windows).
  3. Navigate to where the file you want to copy to a CSE Machine is.
  4. Run:
    • Where:
      • <InternetID> is your UMN InternetID
      • <cse-machine-name> is a CSE computer or machine name. Available machines are listed in the classrooms & labs information.
      • <source_path> is the location where the file you want to copy is.
      • <file> is the file you want to copy.
      • <destination> is the location on your computer you want to copy the file to.
    • Example: scp homework.cpp user1234@csel-kh4250-31.cselabs.umn.edu:/home/user1234/Documents/Assignments
      • In this example the file homework.cpp kept in student1234’s Documents/Assignments folder on the CSE Machine was copied to the /Downloads/Homework folder of student1234’s computer.
  5. Enter your UMN password when prompted.
  6. Authenticate with Duo if prompted.

Copy a File From Your Computer to a CSE Machine

  1. Connect to VPN.
  2. Open Terminal (Mac and Linux) or the Command Prompt (Windows).
  3. Navigate to where the file you want to copy to a CSE Machine is.
  4. Run:
    • Where:
      • <file> is the full path to the file you want to copy.
      • <InternetID> is your UMN InternetID
      • <cse-machine-name> is a CSE computer or machine name. Available machines are listed in the classrooms & labs information.
      • <destination> is the location on your computer you want to copy the file to.
    • Example: scp homework.cpp student1234@csel-kh4250-31.cselabs.umn.edu:/home/student1234/Documents/Assignments
      • In this example, the file homework.cpp will be copied to student1234's Documents/Assignments folder on the CSE Machine.
  5. Enter your UMN password when prompted.
  6. Authenticate with Duo if prompted.

Secure File Transfer Protocol (SFTP)

SFTP is a comprehensive alternative to SCP (and old fashioned FTP), providing a simple command interface that can list remote and local files, change directories, upload and download files, remove remote files, and resume interrupted transfers.

 Start an SFTP Session

  1. Connect to VPN.
  2. Open Terminal (Mac and Linux) or the Command Prompt (Windows).
  3. Navigate to where the file you want to copy to a CSE Machine is.
  4. Run:
    • Where:
      • <InternetID> is your UMN InternetID
      • <cse-machine-name> is a CSE computer or machine name. Available machines are listed in the classrooms & labs information.
    • Example: sftp student1234@csel-kh4250-31.cselabs.umn.edu
  5. Enter your UMN password when prompted.
  6. Authenticate with Duo if prompted.

Using the SFTP Session

  • Navigate the SFTP session with Linux shell commands - as if you were on a CSE Machine.
  • Normal commands will be run on the CSE Machine you are connected to.
  • Prepend commands with an “l” to run the command on the local machine (your computer).
    • Example: change directories on…
      • the CSE Machine: cd /new-directory
      • your computer: lcd /new-directory 
    • Example: list on…
      • the CSE Machine: ls
      • your computer: lls
    • Example: path working directory on …
      • the CSE Machine: pwd
      • your computer: lpwd
    • Note: if you are using a Windows computer you will need to use Linux shell commands to navigate your computer while connected to the SFTP session.

Copy a File from a CSE Machine to Your Computer

  1. Start an SFTP session if you are not already connected.
  2. Navigate to where you want to store the file on your computer.
  3. Navigate  to where the file is stored on the CSE Machine.
  4. Run:
    • Where:
      • <-optional_flags> are optional settings you can add to copy the file.
      • <file> is the file - or directory - you want to copy.
      • <optional_new_name> is an optional new file or directory name you can specify.
    • Example: get homework.cpp project2.cpp
      • In this example, the file homework.cpp is copied from the CSE Machine to your computer and renamed to project2.cpp
    • Example: get -Pr homework-folder csci-homework
      • In this example, the folder homework-folder and all of its contents are copied from the CSE Machine to your computer, the permissions from the CSE Machine are retained, and the folder is renamed to csci-homework.

Copy a File from Your Computer to a CSE Machine

  1. Start an SFTP session if you are not already connected.
  2. Navigate to where you want to store the file on the CSE Machine.
  3. Navigate  to where the file is stored on your comptuer.
  4. Run:
    • Where:
      • <-optional_flags> are optional settings you can add to copy the file.
      • <file> is the file - or directory - you want to copy.
      • <optional_new_name> is an optional new file or directory name you can specify.
    • Example: put homework.cpp project2.cpp
      • In this example, the file homework.cpp is copied from your computer to the CSE Machine and renamed to project2.cpp
    • Example: put -Pr homework-folder csci-homework
      • In this example, the folder homework-folder and all of its contents are copied from your computer to the CSE Machine, the permissions from the CSE Machine are retained, and the folder is renamed to csci-homework.

Optional Flags

Commonly used flags include:

  • -r copy the directory (folder) and all of its contents.
  • -P copy the file while retaining the permissions of the remote file/directory.
  • -Pr copy the directory and all of its contents while keeping the permissions of the remote file/directory.

Remote Sync (rsync)

rsync is another way to copy a directory and all of its contents. Windows requires using a client program

Copy a File from a CSE Machine to Your Computer

  1. Connect to VPN.
  2. Open Terminal (Mac and Linux).
  3.  Run:
    • Where:
      • <-optional_flags> are optional settings you can add to copy the file.
      • <InternetID> is your UMN InternetID
      • <cse-machine-name> is a CSE computer or machine name. Available machines are listed in the classrooms & labs information.
      • <source_directory> is the directory you want to copy. Make sure to include the trailing /
      • <destination_directory> is the location on your computer you want to copy the file to. Make sure to include the trailing /
    • Example: rsync student1234@csel-kh4250-31.cselabs.umn.edu:/home/student1234/Documents/homework/ /Documents/Coursework/
      • In this example, the contents of student1234’s Documents/homework directory on the CSE Machine is copied to the /Documents/Coursework directory on their personal computer.
  4. Enter your UMN password when prompted.
  5. Authenticate with Duo if prompted.

Copy a File from Your Computer to a CSE Machine

  1. Connect to VPN.
  2. Open Terminal (Mac and Linux).
  3.  Run:
    • Where:
      • <-optional_flags> are optional settings you can add to copy the file.
      • <InternetID> is your UMN InternetID
      • <cse-machine-name> is a CSE computer or machine name. Available machines are listed in the classrooms & labs information.
      • <source_directory> is the directory you want to copy. Make sure to include the trailing /
      • <destination_directory> is the location on your computer you want to copy the file to. Make sure to include the trailing /
    • Example: rsync /Documents/Coursework student1234@csel-kh4250-31.cselabs.umn.edu:/home/student1234/Documents/homework/
      • In this example, the contents of student1234’s Documents/Coursework directory on their computer is copied to their /Documents/homework directory on the CSE Machine.
  4. Enter your UMN password when prompted.
  5. Authenticate with Duo if prompted.

Optional Flags

Commonly used flags include:

  • -a is all files, including subdirectories
  • -v is verbose mode.
  • -u skips files that are newer on the destination.
  • -P shows progress being made for files.