2012年4月1日 星期日

ForwardX11 option in ssh_config

To allow ssh client to enable X11 Forwarding always, one can add option "ForwardX11 yes" to /etc/ssh/ssh_config or its own ssh_config under home.

# grep "ForwardX11 yes" /etc/ssh/ssh_config
ForwardX11 yes
 
One may also know that we can tell the ssh client to turn on X11 forwarding from ssh cli via -X or -Y option.

e.g # ssh -X user@1.2.3.4

So, if we have "ForwardX11 yes" be set on ssh_config, all ssh sessions initiated by your machine will be have option "-X" be enabled. However, in some situation you may want to disable this feature and you have no access to /etc/ssh/ssh_config, you can

# ssh -o ForwardX11=no user@1.2.3.4

And then it would stop doing X11 forwarding for that ssh session.

沒有留言:

張貼留言