How to use the command "tailscale file" (with examples)
The “tailscale file” command allows users to send files across connected devices on a Tailscale network. However, it should be noted that this command does not support sending files to devices owned by other users, even if they are on the same Tailscale network. It is a useful tool for sharing files securely within a network.
Use case 1: Send a file to a specific node
sudo tailscale file cp path/to/file hostname|ip:
Motivation: This use case is helpful when you need to send a file from your local machine to a specific node in your Tailscale network. It allows for quick and secure file sharing within the network.
Explanation:
sudo
: The “sudo” command allows you to run the following command with administrative privileges.tailscale file cp
: This is the command to send a file from your local machine to another node in the Tailscale network.path/to/file
: Replace this with the actual path to the file on your local machine that you want to send.hostname|ip:
: Specify the hostname or IP address of the node you want to send the file to.
Example output:
File successfully copied to hostname|ip:path/to/file.
Use case 2: Store files that were sent to the current node into a specific directory
sudo tailscale file get path/to/directory
Motivation: This use case is useful when you want to store files that were sent to the current node into a specific directory. It allows for easy organization and access to the files that were received.
Explanation:
sudo
: The “sudo” command allows you to run the following command with administrative privileges.tailscale file get
: This is the command to retrieve files that were sent to the current node.path/to/directory
: Replace this with the actual path to the directory where you want to store the received files.
Example output:
Files successfully stored in path/to/directory.
Conclusion:
The “tailscale file” command is a handy tool for sending and receiving files within a Tailscale network. It provides a secure and simple way to share files between connected devices. By following the provided examples, users can easily send files to specific nodes and store received files in a desired directory.