← 返回命令列表

Linux command

xauth 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List all authorization entries

xauth list

Display authority file info

xauth info

Add an authorization entry

xauth add [display_name] [protocol_name] [hex_key]

Generate a new authorization entry via the server

xauth generate [display_name] [protocol_name]

Remove an authorization entry

xauth remove [display_name]

Extract entry for the current display to a file

xauth extract [path/to/file] $DISPLAY

Merge entries from a file

xauth merge [path/to/file]

Use a specific authority file

xauth -f [path/to/file] list

说明

xauth edits and displays the authorization information used for connecting to X servers. It manages the ~/.Xauthority file (or the file specified by the XAUTHORITY environment variable) which contains credentials for X11 authentication. The tool is commonly used to extract authorization records from one machine and merge them on another for remote display access, X11 forwarding over SSH, and managing X security.

参数

-f _FILE_
Use the specified authority file instead of ~/.Xauthority.
-v
Verbose mode. Print status messages for operations.
-q
Quiet mode. Suppress unsolicited status messages.
-i
Ignore authority file locks.
-b
Attempt to break stale authority file locks.
-n
Do not resolve hostnames; display stored addresses directly.
-V
Display the xauth version number.

FAQ

What is the xauth command used for?

xauth edits and displays the authorization information used for connecting to X servers. It manages the ~/.Xauthority file (or the file specified by the XAUTHORITY environment variable) which contains credentials for X11 authentication. The tool is commonly used to extract authorization records from one machine and merge them on another for remote display access, X11 forwarding over SSH, and managing X security.

How do I run a basic xauth example?

Run `xauth list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f _FILE_ do in xauth?

Use the specified authority file instead of ~/.Xauthority.