How to set up X11 forwarding in Ubuntu
1) Open the Terminal in Ubuntu.
2) This is what you should see:
First change directories to /etc/ssh with the command
cd /etc/ssh
Press Enter
Now you are in the /etc/ssh directory and can view all the files in this directory by using the command:
LS
example: % ls
We need to make a change to the ssh_config file
Enter the command
sudo gedit ssh_config
Enter your password and a new text window should open.
In the new text window, scroll down until you find the lines:
# ForwardX11 no
# ForwardX11Trusted no
We need to change these lines by deleting the # (hash) sign and changing the “no” to “yes”.
The # is a comment sign.
When you delete # on a line, the command becomes active.
ForwardX11 yes
ForwardX11Trusted yes
Enter the following command to return to the original directory
cd-
Type:
ssh username@servername
ssh anteater@maegrad.eng.uci.edu
Press Enter.
Enter your password when prompted to do so.
Note: You may be prompted to verify the authenticity of the server you want to connect to.
Do so by typing ‘yes’ when prompted.
Type:
ssh -X username@servername
ssh -X anteater@maegrad.eng.uci.edu
Press Enter.
Enter your password when prompted to do so.
Note: This command will only enable X11 forwarding for your current session that you are connected to the maegrad server.