82.10 SSH and the X Window System

20011005

The default Xsession on Debian and Ubuntu is run with ssh-agent so that ssh connections can be initiated more easily (after you have performed an ssh-add). This is controlled by the file /etc/X11/Xsession.options:

use-ssh-agent

You can have your ssh passphrase asked for each time you log on. Using gdm and the Debian Session (rather than the GNOME Session) will load the /home/kayon/.xsession file which can contain:

#!/bin/sh
ssh-add .ssh/id_dsa < /dev/null
exec gnome-session

If you have ssh-askpass and ssh-askpass-gnome installed you will be prompted for your passphrase. All connections to hosts which have the public key will now be direct (no password or passphrase required).

By default the ForwardX11 option for ssh is turned off. Thus, when you connect to remote hosts you won’t be able to display X Window System applications on your screen. You can turn it on per connection with:

  $ ssh -X plymz

Or else you can turn it on for all connections to a particular host by adding the following line to /home/kayon/.ssh/config:

Host plymz
    ForwardX11 yes

Or even more generally allow X Window System forwarding through all connections:

Host *
    ForwardX11 yes


Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0