Automatic display change for multiple users using X11 Forwarding

331 Views Asked by At

I'm configuring a Workstation that we connect through SSH, where the X11 Forwarding is enabled. When only one user is connected, he can use a software where the window will be displayed on his computer. Now, if a second user is connected, when he try to do the same, he gets the error "Cannot open display". Thus, he needs to run the following command: export DISPLAY=localhost:11.0 because the default display localhost:10.0 is already taken by the first user. For the next user, he will need to run the command: export DISPLAY=localhost:12.0, and so on for the next users.

So, I'm looking for a solution where the users doesn't need to do anything to be able to use X11 Forwading

I tried to specify manually a different port to use in the .bashrc for all users but the first user need to use the port 10, the second the port 11, etc.

0

There are 0 best solutions below