6

VNC allows any user to send their windows like xterm, gvim, .. to any other user's VNC, using -display option of command or by setting my VNC display in DISPLAY variable.

Some users exploiting this feature and keep on sending xterms to my VNC. Is there any way where I can completely disable or selective allow other users?

My viewer details:

VNC Viewer 5.2.1 (r5668) 32-bit(Aug 18 2014 12:58:45) from RealVNC

I am looking for some options provided by this viewer/other to achieve this

  • 1
    That has nothing to do with VNC. It's how X11 works. – el.pescado - нет войне Feb 08 '17 at 06:39
  • 1
    This has nothing to do with programming. Voting to move. – n. m. could be an AI Feb 08 '17 at 06:53
  • 1
    @n.m. Yes, it's not related to programming. Please move it to correct StackExchange – Bhargav Katkam Feb 08 '17 at 07:09
  • 2
    The command you're looking for is `xhost`. Read the manual page to understand how it works. It (dis)allows users or hosts to connect to your display. – mrjink Feb 08 '17 at 10:31
  • @mrjink Yes. When I do `xhost -`. Other users unable to send `xterm` to my VNC. Please post as an answer & elaborate on allowing other users selectively. – Bhargav Katkam Feb 09 '17 at 03:53
  • @BhargavKatkam I posted my answer here http://stackoverflow.com/a/42130755/2020834 – mrjink Feb 09 '17 at 07:36
  • 1
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. Also see [Where do I post questions about Dev Ops?](http://meta.stackexchange.com/q/134306) – jww Feb 10 '17 at 15:31

1 Answers1

4

The command you're looking for is xhost. xhost allows you to control access to your X environment and $DISPLAY. In your case, the default is probably "no access control" or xhost +.

By specifying xhost - you will disallow everyone (excluding yourself) access to your current $DISPLAY. Other users won't be able to run commands on your $DISPLAY anymore.

You can selectively add (or remove) users and/or machines from the access list, with xhost +si:localuser:username or xhost +otherhost. For more information on the si: syntax, please see the Xsecurity manual.

mrjink
  • 1,131
  • 1
  • 17
  • 28