1753929 Members
8637 Online
108810 Solutions
New Discussion

Xforwarding SSH

 
SOLVED
Go to solution
dev-s
Advisor

Re: Xforwarding SSH

Here I got another Q:

I forgot to mention something important:
I'm talking on unix shared account - here is the flow:
1. one logon via rdp to my pc (this it the win proxy that runs also the x-server)
2. from this pc, the user open an ssh client (putty for example) and logons to some unix machine remotely (now, I'm monitoring everything this user does)

now, after understanding this flow - when I'm asking localhost: can I enforce each user that logons via the ssh client, that its display screen will be the same RDP screen he opened?


tx,s
Matti_Kurkela
Honored Contributor

Re: Xforwarding SSH

On the Unix/Linux side, the sshd automatically selects the first free port in the 6010+ range and generates the corresponding DISPLAY value. This is unique to each session: the first session gets localhost:10.0, if another session is established while the previous one is still running, the new one gets port 6011 and DISPLAY=localhost:11.0, and so on.

If the session is locked-down so the user cannot modify the DISPLAY value, that should keep the sessions separate in the Unix/Linux end.

On your PC, you may have a bit of a problem if you require multiple simultaneous connections. With just one connection at a time, it's easier.

If you only need to have one RDP session at a time, you can probably lockdown the configuration of the RDP session: most Windows X servers start using port 6000 (corresponding to DISPLAY=localhost:0.0) but can be configured to start in another port. You'll need to lock this down.

PuTTY can be configured to use another X11 port at the Windows side too: the "X display location" configuration item works just like the DISPLAY variable. If it is unset but you have a DISPLAY environment variable in your Windows environment, PuTTY will use it; otherwise PuTTY will assume your X server is at localhost:0.0 by default. You must prevent the user from changing PuTTY configuration too.

If you need to support multiple simultaneous RDP sessions, you must find a way to assign each RDP session an individual X server port number, pass this number to both X server and PuTTY configuration. The last step would be to prevent the user from interfering with this assignment and PuTTY configuration.

There are many Windows Xserver applications and their configuration possibilities vary wildly.

The easiest way to do this with PuTTY would be to set the DISPLAY variable, just like it is used in Linux/Unix systems.

If you need advice on how to achieve that, please ask in a Windows sysadmin forum and please *specify* both your Windows version and your Windows Xserver software version. It seems to me some Windows scripting may be required.

MK
MK