Add only client.example.net to the current X server's host-based access list.
Which command is appropriate?
xhost +HOST adds a host to the access list, but cookie-based xauth or SSH forwarding is generally safer.
Detailed explanation
xauth +client.example.netIncorrect. xauth manages authentication cookies rather than adding a host to xhost's list.
Incorrect. xauth manages authentication cookies rather than adding a host to xhost's list.
xhost +Incorrect. xhost + disables host access control for every host.
Incorrect. xhost + disables host access control for every host.
xhost -client.example.netIncorrect. xhost -HOST removes the specified host.
Incorrect. xhost -HOST removes the specified host.
xhost +client.example.netCorrect. xhost +client.example.net adds the host.
Correct. xhost +client.example.net adds the host.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' 'xhost +client.example.net'Expected result
特定ホスト追加の構文を表示。実Xサーバーへは変更を加えないKey points
- +HOST adds
- -HOST removes
- Avoid xhost + alone
Notes
- Environment: xhost構文の静的確認 / Xサーバー変更なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.