Linux xhost command usage summary

  

Some people are not very familiar with the xhost command under Linux, do not understand the use of the command, in fact, the xhost command is mainly used for X server access control, the specific usage of the xhost command may be small Let's get together to understand.

xhost Command Purpose

control who can access the Enhanced X-Windows on the current host.

Syntax

xhost [ + |  - ] [ Name ]

“+” means increase, “-” means remove

Description

xhost is used to control X server access.

Usually when you log in from hostA to hostB and run the application on hostB, as the application, hostA is the client, but for the graphics, it is displayed on hostA, you need to use hostA The Xserver, so hostA is the server. Therefore, before logging in to hostB, you need to run xhost + on hostA to enable other users to access hostX's Xserver.

xhost + is to enable all users to access Xserver.

xhost + ip enables users on ip to access Xserver.

xhost + nis:user@domain makes domain The nis user on the user can access

xhost + inet:user@domain to enable the inet user on the domain to access the

xhost command to add or remove the host name on the list of machines to which the X server accepts connections .

This command must be run from a machine with a display connection. You can remove a name from the access list by using the -Host parameter. Do not remove the current name from the access list. If you have already done so, log out of the system before making any changes.

Entering an unsigned xhost command displays the current hostname of the accessing X server and displays a message indicating whether access is enabled.

For security reasons, you can only run options that affect access control from the control panel. For workstations, this machine is also the server. For the X terminal, this machine is the login host.

To enable remote names by default, you can do this in /etc/X? The name is defined in the .hosts file, where ? The display number to enable access.

For example, the display jeanne:0 can be accessed by a system defined in the /etc/X0.hosts file on the system using jeanne's default hostname. In the display name and file name, 0 indicates that the defined remote system allows the display number to be accessed by enhancing X-Windows.

Note: - The Name option defines the host name to be removed from the X server access list. The existing connection is not interrupted, but the new connection request will be rejected. Note: The current machine can be removed; however, no further connections are allowed (including attempts to add it back). The only way to enable local connections again is to reset the server (and therefore all connections).

The above is the introduction of Linux using the xhost command. This article describes the main usage of the xhost command. As for the other usages of the xhost command, you can find out.

Copyright © Windows knowledge All Rights Reserved