← 返回命令列表

Linux command

headscale 命令

趣味

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

常用示例

Start the server

headscale serve

Create a user

headscale users create [username]

List users

headscale users list

Create auth key

headscale authkeys create --user [username]

List nodes

headscale nodes list

Register a node

headscale nodes register --user [username] --key [nodekey:abc123]

Delete a node

headscale nodes delete --id [1]

Enable routes for a node

headscale routes enable --route [10.0.0.0/24]

说明

headscale is a self-hosted implementation of the Tailscale control server. It coordinates WireGuard connections between Tailscale clients. serve starts the coordination server. Clients connect to exchange keys and discover peers. Configuration is in /etc/headscale/config.yaml. Users (namespaces) organize nodes. Each user has isolated nodes unless ACL policies allow cross-user communication. Create users before registering nodes. authkeys create pre-authentication keys for unattended registration. Clients use these instead of interactive login. Keys can be reusable or single-use. Subnet routes advertised by nodes require explicit enabling with routes enable. This controls which networks are accessible through the mesh. ACL policies defined in config control traffic between nodes based on users, groups, and tags.

参数

--user, -u _name_
User (namespace) name.
--key _nodekey_
Node key for registration.
--id _id_
Node or route ID.
--expiration _duration_
Key expiration time.
--reusable
Create reusable auth key.
--ephemeral
Create ephemeral auth key.
--tags _list_
ACL tags for auth key.
--output _format_
Output format: human, json, yaml.

FAQ

What is the headscale command used for?

headscale is a self-hosted implementation of the Tailscale control server. It coordinates WireGuard connections between Tailscale clients. serve starts the coordination server. Clients connect to exchange keys and discover peers. Configuration is in /etc/headscale/config.yaml. Users (namespaces) organize nodes. Each user has isolated nodes unless ACL policies allow cross-user communication. Create users before registering nodes. authkeys create pre-authentication keys for unattended registration. Clients use these instead of interactive login. Keys can be reusable or single-use. Subnet routes advertised by nodes require explicit enabling with routes enable. This controls which networks are accessible through the mesh. ACL policies defined in config control traffic between nodes based on users, groups, and tags.

How do I run a basic headscale example?

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

What does --user, -u _name_ do in headscale?

User (namespace) name.