-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+547 KB
...ages/transfer-files-between-computers-via-wireguard/wush-cp-command-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+406 KB
...s/transfer-files-between-computers-via-wireguard/wush-rsync-command-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+337 KB
.../transfer-files-between-computers-via-wireguard/wush-server-command-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+390 KB
...ges/transfer-files-between-computers-via-wireguard/wush-ssh-command-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions
66
docs/others/transfer-files-between-computers-via-wireguard.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# 通过 wireguard 在计算机之间传输文件 wush | ||
|
||
[wush](https://github.com/coder/wush) 是一个命令行工具,用于点对点连接轻松传输文件和打开 shell。 | ||
|
||
它有如下特点: | ||
|
||
1. 无需设置或信任中继服务器进行身份验证。 | ||
2. 由 WireGuard 提供支持,实现安全、快速、可靠的连接。 | ||
3. 通过 UDP 实现自动点对点连接。 | ||
4. `cp`、`rsync`、`ssh`的支持。 | ||
|
||
|
||
## 安装 | ||
```bash | ||
curl -fsSL https://raw.githubusercontent.com/coder/wush/main/install.sh | sh | ||
``` | ||
|
||
|
||
## 基本用法 | ||
|
||
### 服务端 | ||
|
||
```bash | ||
wush serve | ||
``` | ||
|
||
下面是运行命令后得到的输出,当客户端需要连接服务端时,可通过 `<auth-key>` 连接。 | ||
|
||
 | ||
|
||
|
||
### 客户端 | ||
|
||
#### 连接服务端 ssh | ||
|
||
连接时使用的auth-key是服务端运行 `wush serve` 命令后得到的输出中的 `<auth-key>`。 | ||
|
||
```bash | ||
wush ssh --auth-key <auth-key> | ||
``` | ||
|
||
 | ||
|
||
#### 同步文件 rsync | ||
|
||
将文件或目录同步到目标地址。 | ||
|
||
```bash | ||
wush rsync local-file.txt :/path/to/remote/file --auth-key <auth-key> | ||
``` | ||
|
||
 | ||
|
||
|
||
#### 拷贝文件 cp | ||
|
||
连接时使用的auth-key是服务端运行 `wush serve` 命令后得到的输出中的 `<auth-key>`。 | ||
|
||
```bash | ||
wush cp local-file.txt --auth-key <auth-key> | ||
``` | ||
|
||
 | ||
|
||
值得注意的是,拷贝到服务端的目标地址为 `wush serve` 启动时的路径。 | ||
|