1825941 Members
2519 Online
109689 Solutions
New Discussion

ssh question

 
JL Billman
Advisor

ssh question

I am new to ssh and have a few questions to see if it will help me get done what I need to do. We have a VPN to one server and fro mthat server we connect to pther servers in the customer's network. I can ssh to the mahcine that is the gateway to the network but it is not set up to ssh to machine's on the customer network. I know ssh will let me connect to the gateway and then to one other machine but what I am wondering is if I ssh from the customer's internal HP-UX box to another box will the ssh tunnel follow me to the new servers so I can send my X display back to my PC (running putty) and such.

Any help and/or pointers would be appreciated.
4 REPLIES 4
skt_skt
Honored Contributor

Re: ssh question

try an export DISPLAY=IP:DISPLAY_NUMBER:0 and xhost +

where the server has a X display configured on a partuclar number
e.g:-
]# export DISPLAY=IP:13.0
]# xhost +
access control disabled, clients can connect from any host
]# ps -ef|grep X
root 7118 700 0 22:18 pts/9 00:00:00 /usr/X11R6/bin/Xvfb :13 -screen

Or
keep the x program(like refletion X) running on your pc.
export DISPLAY=localpc:0.0
run the program like for example ignite/pv which pop with the respective GUI.
Ralph Grothe
Honored Contributor

Re: ssh question

Usually if you start your SSH session with the -X switch you don't need to export your DISPLAY because ssh will be doing this for you.
It will also tunnel all X traffic.
The only prerequisite is that the SSH server that you connect to has X-Forwarding allowed, which you should check:


$ hostname;grep ^X11Forward /etc/ssh/sshd_config
gomera
X11Forwarding yes


Then connect the client, without, and with -X

$ ssh gomera hostname\;printenv DISPLAY
gomera

$ ssh -X gomera hostname\;printenv DISPLAY
gomera
localhost:11.0

Madness, thy name is system administration
JL Billman
Advisor

Re: ssh question

Thanks for the useful info on the X forwarding.

What I really need to know is if I login to our gateway, login to a customer system insie their network and then connect to another customer system will I be able to forward the X connands to my pC fro tmhe end system?
Kasper Hedensted
Trusted Contributor

Re: ssh question

Hi,

Make sure that you have enabled X11 forwarding in your putty configuration (Connection -> SSH -> Tunnels) and specified your X display location (eg. localhost:0)

Then when you ssh from host to host make sure you use the "-X" option

Best regards,
Kasper