{"id":13456814,"url":"https://github.com/huashengdun/webssh","last_synced_at":"2025-05-13T20:08:50.862Z","repository":{"id":39229263,"uuid":"109987486","full_name":"huashengdun/webssh","owner":"huashengdun","description":":seedling: Web based ssh client","archived":false,"fork":false,"pushed_at":"2024-08-02T16:59:21.000Z","size":1060,"stargazers_count":4785,"open_issues_count":153,"forks_count":1440,"subscribers_count":86,"default_branch":"master","last_synced_at":"2025-04-28T10:55:14.616Z","etag":null,"topics":["asynchronous","paramiko","python","tornado","websockets","xtermjs"],"latest_commit_sha":null,"homepage":"https://webssh.huashengdun.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huashengdun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"huashengdun","custom":"https://bit.ly/2XmXXIP"}},"created_at":"2017-11-08T14:37:03.000Z","updated_at":"2025-04-28T06:36:05.000Z","dependencies_parsed_at":"2024-01-11T17:47:27.673Z","dependency_job_id":"c5cfd6d1-49cf-492e-a306-b3f88db9d7fd","html_url":"https://github.com/huashengdun/webssh","commit_stats":{"total_commits":463,"total_committers":17,"mean_commits":"27.235294117647058","dds":0.06263498920086397,"last_synced_commit":"04a9bd5efff535ab5d80b2dbbedfe146dea4f86c"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huashengdun%2Fwebssh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huashengdun%2Fwebssh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huashengdun%2Fwebssh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huashengdun%2Fwebssh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huashengdun","download_url":"https://codeload.github.com/huashengdun/webssh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254020605,"owners_count":22000752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asynchronous","paramiko","python","tornado","websockets","xtermjs"],"created_at":"2024-07-31T08:01:28.237Z","updated_at":"2025-05-13T20:08:50.838Z","avatar_url":"https://github.com/huashengdun.png","language":"Python","readme":"## WebSSH\n\n[![python](https://github.com/huashengdun/webssh/actions/workflows/python.yml/badge.svg)](https://github.com/huashengdun/webssh/actions/workflows/python.yml)\n[![codecov](https://raw.githubusercontent.com/huashengdun/webssh/coverage-badge/coverage.svg)](https://raw.githubusercontent.com/huashengdun/webssh/coverage-badge/coverage.svg)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/webssh.svg)\n![PyPI](https://img.shields.io/pypi/v/webssh.svg)\n\n\n### Introduction\n\nA simple web application to be used as an ssh client to connect to your ssh servers. It is written in Python, base on tornado, paramiko and xterm.js.\n\n### Features\n\n* SSH password authentication supported, including empty password.\n* SSH public-key authentication supported, including DSA RSA ECDSA Ed25519 keys.\n* Encrypted keys supported.\n* Two-Factor Authentication (time-based one-time password) supported.\n* Fullscreen terminal supported.\n* Terminal window resizable.\n* Auto detect the ssh server's default encoding.\n* Modern browsers including Chrome, Firefox, Safari, Edge, Opera supported.\n\n\n### Preview\n\n![Login](preview/login.png)\n![Terminal](preview/terminal.png)\n\n\n### How it works\n```\n+---------+     http     +--------+    ssh    +-----------+\n| browser | \u003c==========\u003e | webssh | \u003c=======\u003e | ssh server|\n+---------+   websocket  +--------+    ssh    +-----------+\n```\n\n### Requirements\n\n* Python 3.8+\n\n\n### Quickstart\n\n1. Install this app, run command `pip install webssh`\n2. Start a webserver, run command `wssh`\n3. Open your browser, navigate to `127.0.0.1:8888`\n4. Input your data, submit the form.\n\n\n### Server options\n\n```bash\n# start a http server with specified listen address and listen port\nwssh --address='2.2.2.2' --port=8000\n\n# start a https server, certfile and keyfile must be passed\nwssh --certfile='/path/to/cert.crt' --keyfile='/path/to/cert.key'\n\n# missing host key policy\nwssh --policy=reject\n\n# logging level\nwssh --logging=debug\n\n# log to file\nwssh --log-file-prefix=main.log\n\n# more options\nwssh --help\n```\n\n### Browser console\n\n```javascript\n// connect to your ssh server\nwssh.connect(hostname, port, username, password, privatekey, passphrase, totp);\n\n// pass an object to wssh.connect\nvar opts = {\n  hostname: 'hostname',\n  port: 'port',\n  username: 'username',\n  password: 'password',\n  privatekey: 'the private key text',\n  passphrase: 'passphrase',\n  totp: 'totp'\n};\nwssh.connect(opts);\n\n// without an argument, wssh will use the form data to connect\nwssh.connect();\n\n// set a new encoding for client to use\nwssh.set_encoding(encoding);\n\n// reset encoding to use the default one\nwssh.reset_encoding();\n\n// send a command to the server\nwssh.send('ls -l');\n```\n\n### Custom Font\n\nTo use custom font, put your font file in the directory `webssh/static/css/fonts/` and restart the server.\n\n### URL Arguments\n\nSupport passing arguments by url (query or fragment) like following examples:\n\nPassing form data (password must be encoded in base64, privatekey not supported)\n```bash\nhttp://localhost:8888/?hostname=xx\u0026username=yy\u0026password=str_base64_encoded\n```\n\nPassing a terminal background color\n```bash\nhttp://localhost:8888/#bgcolor=green\n```\n\nPassing a terminal font color\n```bash\nhttp://localhost:8888/#fontcolor=red\n```\n\nPassing a user defined title\n```bash\nhttp://localhost:8888/?title=my-ssh-server\n```\n\nPassing an encoding\n```bash\nhttp://localhost:8888/#encoding=gbk\n```\n\nPassing a font size\n```bash\nhttp://localhost:8888/#fontsize=24\n```\n\nPassing a command executed right after login\n```bash\nhttp://localhost:8888/?command=pwd\n```\n\nPassing a terminal type\n```bash\nhttp://localhost:8888/?term=xterm-256color\n```\n\n### Use Docker\n\nStart up the app\n```\ndocker-compose up\n```\n\nTear down the app\n```\ndocker-compose down\n```\n\n### Tests\n\nRequirements\n```\npip install pytest pytest-cov codecov flake8 mock\n```\n\nUse unittest to run all tests\n```\npython -m unittest discover tests\n```\n\nUse pytest to run all tests\n```\npython -m pytest tests\n```\n\n### Deployment\n\nRunning behind an Nginx server\n\n```bash\nwssh --address='127.0.0.1' --port=8888 --policy=reject\n```\n```nginx\n# Nginx config example\nlocation / {\n    proxy_pass http://127.0.0.1:8888;\n    proxy_http_version 1.1;\n    proxy_read_timeout 300;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection \"upgrade\";\n    proxy_set_header Host $http_host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Real-PORT $remote_port;\n}\n```\n\nRunning as a standalone server\n```bash\nwssh --port=8080 --sslport=4433 --certfile='cert.crt' --keyfile='cert.key' --xheaders=False --policy=reject\n```\n\n\n### Tips\n\n* For whatever deployment choice you choose, don't forget to enable SSL.\n* By default plain http requests from a public network will be either redirected or blocked and being redirected takes precedence over being blocked.\n* Try to use reject policy as the missing host key policy along with your verified known_hosts, this will prevent man-in-the-middle attacks. The idea is that it checks the system host keys file(\"~/.ssh/known_hosts\") and the application host keys file(\"./known_hosts\") in order, if the ssh server's hostname is not found or the key is not matched, the connection will be aborted.\n","funding_links":["https://ko-fi.com/huashengdun","https://bit.ly/2XmXXIP"],"categories":["Python","Other","Python (1887)","python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuashengdun%2Fwebssh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuashengdun%2Fwebssh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuashengdun%2Fwebssh/lists"}