Prevent specific keyboard inputs Forums / NoMachine Cloud Server Products / Prevent specific keyboard inputs Tagged: docker, keyboard, linux, Mappings This topic contains 1 reply, has 2 voices, and was last updated by Gega 1 year, 4 months ago. Viewing 2 posts - 1 through 2 (of 2 total) Author Posts March 29, 2018 at 07:14 #18059 devonParticipant I am using Enterprise Desktop Linux. When a user logs into the system via NoMachine, I don’t want the user to be able to access the super keys / Windows key. I have tried to use both the hooks in the node.cfg UserScriptAfterSessionStart “/usr/bin/user-restriction.sh” UserScriptBeforeSessionStart “/usr/bin/user-restriction.sh” to execute a xmodmap command to bind the super key to nothing. For example: #!/bin/bash xmodmap -e “keycode 133=” will result in the following output : xmodmap: unable to open display ‘:1002’ xmodmap -e ‘keycode 133=’ Is this the correct approach to changing keymappings with NoMachine? Or Is there config that can be manipulated to change the mappings ? Thank you April 3, 2018 at 13:52 #18098 GegaParticipant Hello devon, xmodmap command needs X authorization to work properly, therefore it’s necessary to set correct path for x authority cookie. Here’s an example how to correctly set environment variables and run xmodmap: #!/bin/bash export DISPLAY=":$4" export XAUTHORITY="$NX_SYSTEM/var/log/node/C-$(hostname)-$4-$1/authority" xmodmap -e "keycode 133=" This script needs to be run on UserScriptAfterSessionStart event. This reply was modified 1 year, 4 months ago by Britgirl. This reply was modified 1 year, 4 months ago by Gega. This reply was modified 1 year, 4 months ago by Gega. Author Posts Viewing 2 posts - 1 through 2 (of 2 total) This topic was marked as solved, you can't post.