Department of Information Technology

Secure SHell

What are SSH, SCP and SFTP

SSH, Secure Shell, is a program you can use to connect to another computer on the internet. The information sent between the two computers by ssh is encrypted, so that it cannot be read by others. SCP offers command line file transfer based on the same encryption as SSH. SFTP also offers encrypted file transfer, but with an interactive user interface. This means that you can browse files and folders and select those you want to transfer.

SSH works, but not SFTP and SCP

If you get an error message like "Received message too long 1466459502" when trying to use SFTP, it probably is because something that prints out text is added to the file .bashrc. Note that it is the file .bashrc on the system towards which you are running SFTP. Modify the file so that the text is printed only when there is a terminal associated with the session, as in this example:

   if [ -n "$TTY" ]; then
     fortune
   fi

The above also holds for SCP, but then there is no error message; you will probably only see the text that is printed by .bashrc, and no files are copied.

Fetching SSH and SFTP

Unix/Linux

  • OpenSSH - Is usually preinstalled.

Microsoft Windows

Visit our page about recommended free software for a list of recommended SSH software.

Apple macOS

The commandline-version of SSH is included with the OS.
Visit our page about recommended free software for a list of recommended SSH software.

Using SSH and SFTP

SSH/SCP Windows

SSH/SCP Unix

Log in
ssh -l user computer
Example: ssh -l abcd1234 celsius.it.uu.se
Copy a file to another computer
scp local_file user@computer:file
Copy a file from another computer
scp user@computer:file local_file

SSH/SCP Mac

SCP (Text based)

  1. As steps 1 and 2 for ssh
  2. Click "Scp..." (if the button is not active, first do step 3 for ssh above)
  3. If you want to send files to the SUN computer:
    1. Select "Send Files/Folders" at the top of the dialog window.
    2. Click "Add file/folder" in order to select which files on the Mac you want to transfer.
    3. "Destination path" should be the name of the folder (under your home folder on the SUM system) to which you want to transfer the files, e.g. programming/introLab. If no destination path is entered the files will end up in your home folder.
  4. If you want to fetch files from the SUN system:
    1. Select "Receive Files/Folders" at the top of the dialog window.
    2. "Source file" should contain the names of the files you want to fetch from the SUN system, e.g. documents/letter.doc. The full path must be given if you want to fetch files from outside of your home folder.
    3. On the macen you must select the folder you want to put the copied files into. Click "Pick folder" under "Download folder".
  5. Clic "Start Copy". A dialog box prompting for the user name and password for the SUN system appears.

SFTP using Fugu

  1. Pick a machine to connect to ( list here )
  2. Enter your username as shown in the picture
    1. Picture 2.png
  3. Press "Connect".
  4. Enter your unix password when prompted
  5. You will now see your unix file system
Updated  2016-09-07 20:41:32 by Joel Fredrikson.