Prepare WebSSH for self-hosted deployment

This commit is contained in:
jocayn
2026-06-13 12:11:36 +08:00
parent aaac2afe2a
commit 845c3dece3
20 changed files with 1628 additions and 183 deletions
+31 -3
View File
@@ -45,7 +45,29 @@ A simple web application to be used as an ssh client to connect to your ssh serv
1. Install this app, run command `pip install webssh`
2. Start a webserver, run command `wssh`
3. Open your browser, navigate to `127.0.0.1:8888`
4. Input your data, submit the form.
4. Create the WebSSH administrator account on first visit
5. Input your ssh data, submit the form.
### WebSSH login and saved connections
WebSSH requires a login before opening ssh sessions. On first startup, if no
administrator password has been configured, the login page will ask you to
create one. The password is stored as a PBKDF2 hash under the data directory,
not as plain text.
You can also provide credentials with environment variables:
```bash
WEBSSH_AUTH_USERNAME=admin WEBSSH_AUTH_PASSWORD='strong-password' wssh
```
Saved connections are stored under the data directory too. WebSSH saves
hostname, port, username and terminal type for quick reconnects. It does not
persist ssh passwords, private keys, key passphrases or TOTP codes.
Use `--auth=false` only for a trusted private deployment where another layer
already protects access to WebSSH.
### Server options
@@ -66,6 +88,9 @@ wssh --logging=debug
# log to file
wssh --log-file-prefix=main.log
# data directory for login and saved connection data
wssh --data-dir='/path/to/webssh-data'
# more options
wssh --help
```
@@ -153,14 +178,17 @@ http://localhost:8888/?term=xterm-256color
Start up the app
```
docker-compose up
docker compose up -d
```
Tear down the app
```
docker-compose down
docker compose down
```
The bundled compose file persists login and saved connection data in the
`webssh-data` volume mounted at `/data` inside the container.
### Tests
Requirements