SSH/SFTP for Windows and Mac

SSH and Secure File Transfer Protocol

SSH is a command-line utility designed for logging into and executing commands on a remote system (opal.ils.unc.edu for example). SFTP is a way to transfer files in a secure manner between a local and a remote system. Apple macOS and Windows 10 have built-in SSH clients. Multiple alternative SSH and SFTP clients exist and free clients such as PuTTY and Filezilla, WinSCP, and Cyberduck are available for download.

SSH Keys

If you signed into ruby.ils.unc.edu prior to April 2nd 2021, you have outdated SSH keys. You must delete any SSH key reference to “ruby.ils.unc.edu” in order to re-connect successfully.
For Window and Mac, edit or delete the file below. A UNC VPN connection is still required to access ruby from off-campus.

Windows:
Use notepad or another text editor on the “known_hosts” file. You can delete the file or simply delete the line for ruby. The file is here:
    C:\Users\username\.ssh\known_hosts

MacOS:
On MacOS you must modify or delete the /users/apple/.ssh/known_hosts file.
Using Terminal is one easy approach to fixing this. When you open a Terminal window, it will put you in your home directory.
Next, change into the “.ssh” subdirectory by typing:
   cd .\.ssh
The “ls -a” command will show files in that .ssh folder.
    ls -a
The “rm” command will let you delete the “known_hosts” file as follows:
    rm known_hosts
You could attempt this action using Finder, for example. However, there are more steps involved before you can even view the hidden files and folders such as the “.ssh”.

Windows SSH/SFTP

Note: Windows 10 has a built in SSH that can be launched by navigating to "Apps and Features", selecting "Optional features" and clicking "OpenSSH Client" to install. Other client options include Filezilla and WinSCP.
SSH connections can be made from the Windows command line or Windows PowerShell:

Windows command line

Windows PowerShell window

Mac SSH/SFTP

First open a terminal window

  • Open Finder -- select Applications -- select Utilities -- then select the Terminal icon. 

Terminal icon

Using SSH

At the prompt, type in this command:

ssh remote_username@remote_systemname

Replace remote_username with your username and remote_systemname with the name of the system you are connecting to (for example, onyen@opal.ils.unc.edu ). 

Terminal interface

 

Enter your password when prompted. You may also be prompted to accept a host security key. You must type "yes" to continue. 

Key prompt in the Terminal interface

 

Using SFTP

Unless you are really knowledgeable about the file structure of your computer, it is a good idea to navigate to the folder you want to transfer files into or out-of on your computer before you open a connection to a remote system. Use pwd and cd at the prompt to navigate to a suitable folder on your system. Once there, type:

sftp remote_username@remote_systemname

Where remote_username is your username on the system and remote_systemname is the name of the system you are connecting to (for example, onyen@opal.ils.unc.edu ).

Enter your password at the prompt. Now when you cd around the system, you are moving between folders on the remote system. Change to the remote folder where you will be transferring files to/from. Use put, get, mput, or mget to transfer files between the remote system and your own. Type quit to exit the SFTP session.

Other SSH clients are available for macOS including Cyberduck and FileZilla.