SSH stands for Secure SHell, and creates a encrypted connection between you and the place you are connecting to. In this article we discuss how to create an SSH connection to NTNU's servers, some SSH clients, as well as how to use SSH with X-window.

Norsk versjon - Sikker med SSH

Looking for something else? Topic page about IT services | Pages labeled with ssh vs

Students can connect to using SSH with their computers built in terminal-application as described below, or use one of the programs described further down. Employees can connect to

Throughout this article, we will use in examples. Replace this with if you are an employee.

SSH using terminal

The simplest way to connect using SSH is to use your computers default terminal-application. The example below shows how to connect to using SSH.

  1. Open a terminal-application
    • Mac: Open the application: Terminal
      (Press cmd+spacebar and search for "terminal")
    • Windows: Open the application: Command Prompt
      (Press the Windows-button and search for "Command Prompt")
  2. Enter and run the following command: ssh
    (Replace "username" with your own NTNU-username)

To read about what you can do with SSH,  run the command "man ssh" in the terminal/shell. This will show you the SSH manual pages. 


This is a variety of links to different SSH clients you can install on your computer. As mentioned above it is not necessary to install any of these programs to use SSH.

These programs are meant to be installed on your personal computer only. Do not install them on NTNU computers without speaking with the system administrator first. The system administrator should ensure that an SSH client is installed on all NTNU computers.

ClientOperating systemLicense type
OpenSSH  UNIX, Linux, MacOS  Freeware

Setting up X-window forwarding with SSH

What is X-Window Forwarding?

With X-Window Forwarding you can access graphical applications on your personal computer, even if the applications are on one of NTNU's servers.

Setup (Windows)

X-windowing is not found on standard Windows installations, but you can connect to an X-window server by using X-Win32 and then connecting to when you are asked what server to connect to.

Setup (Linux/UNIX/MacOS X)

  1. Install X-window tools
  2. Open a terminal/console and run the command: ssh -X -C

This sets up X-window forwarding automatically. The DISPLAY variable on the computer you are logging onto should also be set automatically upon login. The -C option compresses the connection, which is desirable when forwarding X-window. If you encounter any issues, read on to the section below.

Common problems

Troubleshooting on the computer you connect to (X-window)

To check if the DISPLAY variable was set correctly, you should run the following command in bash/csh/tcsh:

env | grep DISPLAY

(note that this command is case sensitive). You should then get a result that looks something like:


The number after DISPLAY=localhost: can vary from login to login, and you are not supposed to set DISPLAY yourself. This will set up a normal, unencrypted connection.

Troubleshooting on the machine you are connecting with(X-window)

Remember that the DISPLAY variable must be correctly set on the machine you are connecting with. This is not set automatically. If you are connecting with Linux from home, you can use the console to check that the DISPLAY variable has been set correctly by running:

env | grep DISPLAY

This will normally return


You can test if this works by running:


If you don't receive any error messages, and a new terminal window appears, everything is set up correctly. If not you should set the DISPLAY variable manually. In bash, that is done by running the following command:

export DISPLAY=localhost:0.0

and in csh/tcsh the same operation is done by running:

setenv DISPLAY localhost:0.0

Also see


Orakel Support Services can help you install an SSH client, and show you how to connect to NTNU's servers.