Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Handle ssh X11 forwarding in .bashrc' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Handle ssh X11 forwarding in .bashrc
Authored by: emarmite on Sep 27, '05 01:30:22PM
Er, have I misunderstood this hint? To enable X11 forwarding, simply use the -X flag in ssh:

-X Enables X11 forwarding. This can also be specified on a per-host basis in a configuration file.

X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user's X authorization database) can access the local X11 display through the forwarded connection. An attacker may then be able to perform activities such as keystroke monitoring.

-x Disables X11 forwarding.

-Y Enables trusted X11 forwarding.

If you're talking about ssh'ing to an OSX server, X11 forwarding should be enabled by default. To be sure edit as sudo /etc/sshd_config, uncomment #X11 forwarding no, change 'no' to 'yes', and restart sshd.

Finally, as you don't want to do X11 forwarding by default, you can automatically enable it per host by adding the following lines to ~/.ssh/config (create the file if it's not already there):

Host testbox
ForwardX11 yes

Change testbox to be the name or IP address of the host you are accessing.

Have I missed the point of this script?

[ Reply to This | # ]
Handle ssh X11 forwarding in .bashrc
Authored by: kholburn on Sep 27, '05 04:33:22PM

You have to do all that X11Forwarding stuff you talked about on the ssh client or none of this will work.

Even if you do all that client X11Forwarding, if your "server" is not set up do X11Forwarding correctly it still won't work. When you ssh to a "server" the server sshd process sets the DISPLAY environment variable. If your log-in script resets it, ssh X11Forwarding won't work.

Finally I wasn't talking about sshing to an OSX Server, but to an OSX machine.

[ Reply to This | # ]
Handle ssh X11 forwarding in .bashrc
Authored by: EddEdmondson on Sep 28, '05 08:46:57AM

Actually you want 'ssh -Y' since Tiger.

[ Reply to This | # ]
Handle ssh X11 forwarding in .bashrc
Authored by: Anonymous on Mar 17, '06 12:20:07PM

Now that's a hint! I've been racking the Brain Housing Group over this one.

Salmon, the other pink meat.

[ Reply to This | # ]