|
|
Handle ssh X11 forwarding in .bashrc
Assuming that SSH forwarding is allowed on the server you connecting to(default is no), then you shouldn't have to touch anything in your environment. The only two things you need to do are:
1) Run SSH from an X11 terminal (default for Apple's X11 is xterm, KDE is kterm, etc...) 2) use the -X option to tell SSH to setup the forward. (ssh -x hostname) $DISPLAY is a variable that's maintained by the system when you are using X and really shouldn't be messed with unless you know what you're doing. To see what I mean, launch X and in the xterm type "echo $DISPLAY". You'll see that it's already set to :0.0. What this means is the XServer is listening to 127.0.0.1:600n (where n is the display prefix ie :x.0). If you have X set to respond to outside/remote connections then it's likely hostname:0.0. Now when you ssh -X to a remote machine from that terminal and echo your DISPLAY, by default you should see something like hostname:10.0 which is a tunnel back to your local setting. So by using SSH inside X11 terminals you shouldn't have to worry about setting your DISPLAY manually. Below is a quick function you can add to your .bashrc to replace the ssh command with c, and when it runs it will run ssh -X if you are using X11.
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.08 seconds |
|