Home / Disable clipboard copy-paste in VNC Sessions on Alma Linux, CentOS 8 & 9

Disable clipboard copy-paste in VNC Sessions on Alma Linux, CentOS 8 & 9

Rent Linux Dedicated Server

Affordable prices and 100% Uptime!

Note that VNC connections are configured to perform copy+paste from clipboard by design and by default.

if you are still using "vncserver" command to start the VNC Server than configure the VNC on the system in the recommended way for multi-user access, by adding users in the below file.

-> '/etc/tigervnc/vncserver.users'

If your machine is already configured to use multi-user access skip to the section "Add the below configuration text" below.

After adding the users, enable the VNC server service to startup at boot and start the vncserver service using the below command.

# systemctl enable --now vncserver@:<display number>

After you enable and start the VNCServer check if they were running or not, using the below command.

# systemctl status vncserver@:<display number>

After configuring the users, and starting the vnc services, check if the machine is listening to the incoming connections using the below command.

# netstat -plant

Add the below to configuration text to the end of the configuration files.

AcceptCutText=0
SendCutText=0
noclipboard

Add the above parameters to below files.

-> '/etc/tigervnc/vncserver-config-defaults'
-> '/etc/tigervnc/vncserver-config-mandatory'

After performing the above, you need to restart the required VNC server services, and connect to the VNC sessions to check if copy-paste from clipboard is still working on the VNC session.

# systemctl restart vncserver@:<display number>

Connect to the VNC server and check if the issue is resolved.

Leave a Reply