
gotty
gotty
Overview
gotty
is a lightweight tool that exposes your terminal over a web interface. It allows anyone to connect and run commands in your local shell.
How it works
- The server listens on a specified port, typically
127.0.0.1:8080
. - A client connects via a browser (or any HTTP client) and sends command strings over the WebSocket. The server executes these commands in your local terminal and streams output back to the client.
Basic Usage
# Start the server on default port 8080
gotty
This will open a web page at http://localhost:8080
. You can use it with a browser or any tool that supports WebSocket communication.
Examples
Simple Terminal Access
gotty
Open your browser and navigate to http://localhost:8080
.
You will see the terminal displayed, and you can type commands directly in the page. The output will appear as a scrollable text area.
Remote Access with Credentials
gotty --credential username:password
The server requires Basic Authentication. You must provide the username and password. Any client that connects with the correct credentials can interact with the terminal.
Common Pitfalls
- Port conflicts: If another service uses port 8080, you will need to choose a different port.
- Security: Without authentication, anyone can run arbitrary commands on your system. Use
--permit-write
or--credential
to restrict access. - Environment: The server runs in the same environment as your shell; it may not be able to handle background processes or non-interactive sessions.
Advanced Options
gotty --permit-write shell
This allows remote users to execute commands directly. However, you should carefully control what is allowed to run. For example, you can set a whitelist of commands.
Additional Notes
-
The output is displayed as plain text; no formatting or color. You might want to add CSS styling for better readability.
-
If you need persistent sessions, consider using
--permit-write
with session management.
References
-
GitHub: https://github.com/yudai/gotty
-
Documentation: https://github.com/yudai/gotty/docs.html