d74457d198
ci / test (push) Has been cancelled
ci / fuzz-smoke (push) Has been cancelled
ci / windows-client (push) Has been cancelled
ci / package-release (linux-x86_64, ubuntu-latest) (push) Has been cancelled
ci / package-release (macos-aarch64, macos-14) (push) Has been cancelled
ci / package-release (macos-x86_64, macos-13) (push) Has been cancelled
ci / package-release (windows-x86_64, windows-latest) (push) Has been cancelled
ci / remote-bench (push) Has been cancelled
124 lines
2.7 KiB
Markdown
124 lines
2.7 KiB
Markdown
# Dosh
|
|
|
|
Dosh is an encrypted remote terminal for fast reconnecting shells.
|
|
|
|
It runs a `dosh-server` on a Unix-like host and a `dosh` client on macOS,
|
|
Linux, or Windows. Setup can use SSH, then Dosh connects over encrypted UDP,
|
|
keeps sessions alive across disconnects, supports terminal apps, and can carry
|
|
TCP forwarding, file copy, and VS Code Remote-SSH streams.
|
|
|
|
## Support
|
|
|
|
- Client: macOS, Linux, Windows
|
|
- Server: Linux and other Unix-like systems with PTYs
|
|
- Default UDP port: `50000`
|
|
- Windows: client only
|
|
|
|
Dosh is meant to replace Mosh and everyday interactive SSH sessions. It does
|
|
not currently include SFTP, X11 forwarding, or a Windows server.
|
|
|
|
## Install
|
|
|
|
Unix/macOS server and client:
|
|
|
|
```sh
|
|
curl -fsSL https://git.palav.dev/Palav/dosh/raw/branch/main/install.sh | sh -s -- both --repo https://git.palav.dev/Palav/dosh.git --port 50000
|
|
```
|
|
|
|
Unix/macOS client only:
|
|
|
|
```sh
|
|
curl -fsSL https://git.palav.dev/Palav/dosh/raw/branch/main/install.sh | sh -s -- client --repo https://git.palav.dev/Palav/dosh.git
|
|
```
|
|
|
|
Windows client:
|
|
|
|
```powershell
|
|
irm https://git.palav.dev/Palav/dosh/raw/branch/main/install.ps1 | iex
|
|
```
|
|
|
|
## Use
|
|
|
|
```sh
|
|
dosh setup HOST
|
|
dosh HOST
|
|
dosh HOST COMMAND
|
|
dosh update
|
|
dosh update --client|--server|--both
|
|
```
|
|
|
|
Useful commands:
|
|
|
|
```sh
|
|
dosh exec HOST COMMAND
|
|
dosh cp SRC DST
|
|
dosh ls host:path
|
|
dosh cat host:path
|
|
dosh mkdir host:path
|
|
dosh rm [-r] host:path
|
|
dosh forward HOST -L 8080:127.0.0.1:80
|
|
dosh forward HOST -D 1080
|
|
dosh forward HOST -R 2222:127.0.0.1:22
|
|
dosh status HOST
|
|
dosh doctor HOST
|
|
dosh recover HOST
|
|
dosh restart HOST
|
|
```
|
|
|
|
Agent forwarding is opt-in with `-A` and must also be enabled on the server.
|
|
File copy must be enabled by the server config.
|
|
|
|
## VS Code
|
|
|
|
Dosh can carry VS Code Remote-SSH through its transport:
|
|
|
|
```sh
|
|
dosh vscode setup HOST
|
|
dosh vscode HOST /remote/path
|
|
```
|
|
|
|
This creates a managed SSH config entry using `ProxyCommand dosh proxy-stdio`.
|
|
VS Code still uses Remote-SSH and its normal remote server; Dosh carries the
|
|
SSH byte stream.
|
|
|
|
## Config
|
|
|
|
```text
|
|
~/.config/dosh/client.toml
|
|
~/.config/dosh/hosts.toml
|
|
~/.config/dosh/server.toml
|
|
```
|
|
|
|
Common client settings:
|
|
|
|
```toml
|
|
default_session = "new"
|
|
predict = true
|
|
cache_attach_tickets = true
|
|
disconnect_status = true
|
|
```
|
|
|
|
Example host entry:
|
|
|
|
```toml
|
|
[prod]
|
|
ssh = "prod"
|
|
ssh_config = "prod" # OpenSSH alias for IdentityFile, ProxyJump, SendEnv, etc.
|
|
dosh_host = "prod.example.com"
|
|
port = 50000
|
|
```
|
|
|
|
## Rust Library
|
|
|
|
Dosh exposes a Rust transport for encrypted, reconnecting application streams.
|
|
Use `dosh::client::DoshClient` and `dosh::server::DoshServer` for the normal
|
|
native-auth path. Use `dosh::transport::DoshTransport` only when you already
|
|
own session setup and authentication.
|
|
|
|
Runnable examples:
|
|
|
|
```text
|
|
examples/sdk_echo_client.rs
|
|
examples/sdk_echo_server.rs
|
|
```
|