Disabling user permissions to run the xhost command

You can prevent the unauthorized execution of the xhost command by using the chmod command.

Another way to ensure that the xhost command is being used appropriately is to restrict execution of this command to root-user authority only. To do this, use the chmod command to change the permissions of /usr/bin/X11/xhost to 744, as follows:
chmod 744/usr/bin/X11/xhost