How can I set -X (X11Forwarding) in my ~/.ssh/config file for a specific host?
30,663
If you peek into the manual page for ssh_config
, you will find an option ForwardX11
, which can be put in your config such as:
Host wk
Hostname W.X.Y.Z
ForwardX11 yes
And then your connections to host wk
will have X11 forwarding enabled by default.
Related videos on Youtube
Author by
Albin Glad
Updated on September 18, 2022Comments
-
Albin Glad almost 2 years
So if I'm VPN'ing in from home, I want all of those connections to have
-X
specified. I already have the keys copied and an entry in~/.config
with the ip and userid so all I have to do is go:ssh wk
so this is the last fly in the ointment. -
Albin Glad over 8 yearsYup. Numbskull moment for me although in the past the settings were different in /etc/ssh/sshd_config than they were in ~/.ssh/config
-
Jakuje over 8 yearsthey still are.
ssh_config
andsshd_config
are different things with different options and different manual pages with description inside. -
Shapeshifter almost 5 yearsthis is worth a read for anyone landing here security.stackexchange.com/questions/14815/…