LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Can I hide local screens when using VNC viewer? (https://www.linuxquestions.org/questions/linux-server-73/can-i-hide-local-screens-when-using-vnc-viewer-4175625943/)

mfoley 03-20-2018 09:08 AM

Can I hide local screens when using VNC viewer?
 
I have an interesting problem. One of the "features" of VNC is the ability for the remote view and the local user to see and manipulate the screen concurrently. However, I have a user who is a lawyer and he reported to me that when he was composing a letter remotely, a person that happened to be in his office at work could see the letter and watch him type. For privacy reasons, this doesn't make him happy.

The VNC server is x11vnc. This server has options for not letting the local user use the mouse (-grabptr) or keyboard (-grabkbd), but no VNC server I know of has the option to turn off the display.

Is there some such program that can be run to put physical screens in 'standby' or power-saving mode which can only be turned on by the physical keyboard? A KDE screen-save solution won't work because that cancels with any KDE input, local or remote.

pan64 03-21-2018 03:13 AM

I don't think so, vnc mirrors the local display (and keyboard and mouse), so everything should work the same way locally and remotely.
What you can do is: unplug the display for example.
Another option would be to use a fake X11 display which will not use the local screen at all, therefore nothing will be displayed. But in that case you cannot switch it on.

273 03-21-2018 03:37 AM

Similalrly to the above -- you could run something like tightvnc to create an "invisible" X session and connect to that.

mfoley 03-29-2018 10:40 PM

What about a mechanical solution? How about a power strip controlled by a USB? I could turn the strip on and off based on the user logging in or out of the VNC Server. Does such a thing exist?

linuxbawks 04-05-2018 07:08 AM

Quote:

Originally Posted by mfoley (Post 5833161)
I have an interesting problem. One of the "features" of VNC is the ability for the remote view and the local user to see and manipulate the screen concurrently. However, I have a user who is a lawyer and he reported to me that when he was composing a letter remotely, a person that happened to be in his office at work could see the letter and watch him type. For privacy reasons, this doesn't make him happy.

The VNC server is x11vnc. This server has options for not letting the local user use the mouse (-grabptr) or keyboard (-grabkbd), but no VNC server I know of has the option to turn off the display.

Is there some such program that can be run to put physical screens in 'standby' or power-saving mode which can only be turned on by the physical keyboard? A KDE screen-save solution won't work because that cancels with any KDE input, local or remote.

VNC works best as a localised solution. Namely if you are around the workspace and want to interconnect many peripherals together. If you are remote then compose your work locally and then transfer the data via ssh. It's odd that you're working and transmitting your work over a line. But not just that, VNC also tends to be very finicky and unstable. x11vnc which is already quite a stripped down service tends to topple over more easily and more frequently that anyone would hope for.

mfoley 04-06-2018 05:24 PM

Quote:

Originally Posted by linuxbawks (Post 5839620)
VNC works best as a localised solution. Namely if you are around the workspace and want to interconnect many peripherals together. If you are remote then compose your work locally and then transfer the data via ssh.

Thanks for your input. I'm not totally in agreement with the "VNC works best as a localised solution." In fact, I've never really had occasion to use VNC as a mechanism for connecting many local peripherals. My need is to reproduce the ability for office staff to work from home on Linux via VNC like they could with Remote Desktop on Windows. These are "normal" users, not techy, so they aren't familiar with ssh transfer, nor are their workstation user accounts authorized for ssh. Furthermore, they generally have office-only programs (QuickBooks) and database access they can only get to from their office workstations.
Quote:

It's odd that you're working and transmitting your work over a line. But not just that, VNC also tends to be very finicky and unstable. x11vnc which is already quite a stripped down service tends to topple over more easily and more frequently that anyone would hope for.
Well, again, my experience is a bit different. The line is secured with stunnel. I've actually never experienced VNC toppling over during a session (Windows client: Real VNC, Linux client TigerVNC). x11vnc is the only one I've found that will run at boot-time and let a remote client connect to any local account. There were other advantages I've to x11vnc I've posted elsewhere on LQ, one of which is http://www.linuxquestions.org/questi...7/#post5437756. The main drawback with x11vnc is that author Karl Runge seems to have disappeared off the planet, so this package my be a dead-end for future maintenance.

Quote:

Originally Posted by mfoley (Post 5837175)
What about a mechanical solution? How about a power strip controlled by a USB? I could turn the strip on and off based on the user logging in or out of the VNC Server. Does such a thing exist?

I've made some progress on this approach. There is a usb controlled power strip: http://www.pwrusb.com/powerUSB-basic.html. I've written to the manufacturer to see if there is a command-line usable api.

linuxbawks 04-06-2018 06:54 PM

I use x11vnc. Its the only server I care to use because of its simplicity.
If you let a remote client connect to any local account then this is bound to be insecure.

I recommend to make a provision on your host systems in the event x11vnc crashes to restart itself.

Code:

#! /bin/sh

while true; do
    # Log stderror to a file
    /usr/bin/x11vnc 2> /var/log/x11vnc.log
done

exit 0


mfoley 04-07-2018 08:25 PM

Quote:

Originally Posted by linuxbawks (Post 5840223)
I use x11vnc. Its the only server I care to use because of its simplicity.
If you let a remote client connect to any local account then this is bound to be insecure.

Possibly, but I'm trying to mimic Remote Desktop. I've taken precautions. Only Active Directory users can log in. If a hacker gets past the stunnel password, the AD will give a limited number of tries before locking out the workstation and blocking the offending IP. All such attempts are immediately emailed to me and, if I'm not paying enough attention to my email, an "OOGA" alarm horn sounds to get my attention.
Quote:

I recommend to make a provision on your host systems in the event x11vnc crashes to restart itself.
I believe I'm doing that with x11vnc itself using -loop -repeat -forever. If it ever totally crashes and won't restart itself, that would be a different, more serious problem. So far, in 2 years of using x11vnc server it's never crashed in such a fatal way.

satankush 02-22-2021 09:35 AM

possible solution
 
You can log into your remote server with ssh and run this while loop

Code:

while true; do
    xset -display :0 dpms force off
    sleep 1
    done

and then connect via vnc.
This should keep your remote server's monitor off while you use vnc.
Afterwards you can just kill the loop.

mfoley 02-22-2021 11:59 AM

Interesting suggestion. I'll give that a try.

satankush 02-23-2021 06:44 AM

You might want to remove the line with sleep, this might not really work well with screens that acquire signal pretty fast; might cause them to flicker, but works fine on my desktop monitor which takes about 2-3 seconds to get a signal from my gpu


All times are GMT -5. The time now is 10:35 PM.