X11 forwarding over SSH

X11 forwarding allows the graphical interfaces of X11 application running on a remote Linux server to be displayed on your local machine. This can be very helpful for graphical linux tools such as gparted.

On the remote machine first install xauth:

and make sure X11 forwarding is enabled in the sshd_config:

If it is off:

ensure that is enabled:

X11Forwarding yes

and restart the sshd:

On a OS X machine you first have to install XQuartz.
Now you should be able to ssh into your machine and see its X11 display:

An error you may encounter is that the .Xauthority does not exist yet:

which can be mitigated simply by:

on the remote machine.

SSH Access with certificates

To easily access all your computers you may want to authenticate yourself with certificates.

On a Mac, first install the missing ssh-copy-id:

Then you can copy your public key to the ssh hosts you frequently need by:

You may get this warning if the host already is in known hosts:
Warning: the RSA host key for 'panda' differs from the key for the IP address '10.152.196.248'
Offending key for IP in /Users/tatsch/.ssh/known_hosts:19
Matching host key in /Users/tatsch/.ssh/known_hosts:24
Are you sure you want to continue connecting (yes/no)? yes

If that happens, simply delete the offending lines by

and ctrl + K to delete the whole line