Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've currently have the following situation.

I have a server, that is connected to the internet with ssh (on a non 22 port). This is an ubuntu server without X server. Now i have a machine inside this network, that is used as a desktop machine.

Is it possible to forward all request on a specific port (for the server) directly to that desktop machine, to be able to use the Xserver over SSH?

share|improve this question
    
What OS, terminal software and X server are you using on the local machine? –  Dennis Williamson Jan 31 '11 at 15:46

2 Answers 2

Just pass the -X argument when connecting to your server using ssh, and you'll be able to launch applications on the server that are displayed on the client.

share|improve this answer
    
Eraser, i need indeed connect to the server, but this server doesn't have xserver installed. And i need to run applications from the desktop that's behind the server. –  Grezly Jan 31 '11 at 15:02
    
Ok, so you want to connect to the server, and the server will actually forward your request to the desktop? –  lmontrieux Jan 31 '11 at 15:06
    
The just create an ssh tunnel. See the -L arg documentation in the ssh man page. –  lmontrieux Jan 31 '11 at 15:06

By far the simplest way to do this is to install VNC Server on the Desktop machine.

Then you can do the following from your laptop with RealVNC Viewer installed: vncviewer desktop:1 -via user@servername.domain.com

To connect directly to the desktop. This will automatically SSH to servername.domain.com, forward a port to the destination VNC server, then connect to that port. Replace desktop with the internal DNS name or IP of the desktop, and of course the rest should be obvious there.

As an alternative there's also X forwarding, which you can bounce through a tunnel, but XLib does not make any attempts to optimize for bandwidth.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.