Introduction
TermPair is a web service that allows anyone to view and control their Terminal sessions in real time from a web browser. Simply put, it lets people collaborate, view, share, all in real time.
You can quickly and securely share your Terminal to the Web and access as well as control it.
TermPair is good for those who wants to collaborate in real-time. It also has some security loopholes. If you’re not careful, it could be a catastrophic mistake.
Security
TermPair uses 128 bit end-to-end encryption for all terminal input and output.
The browser must be running in a secure context. This typically means running on localhost, or with secure http traffic (https).
Usage
First, the termpair server is started (termpair serve). The server acts as a router that blindly forwards encrypted data between TermPair terminal clients and connected browsers.
It listens for termpair websocket connections from unix terminal clients, and maintains a mapping to any connected browsers.
Before the TermPair client sends terminal output to the server, it encrypts it using a secret key so the server cannot read it. The server forwards that data to connected browsers. When the browsers receive the data, they use the secret key to decrypt and display the terminal output. The browser obtains the secret key via a part of the url that is not sent to the server.
Likewise, when a browser sends input to the terminal, it is encrypted in the browser, forwarded from the server to the terminal, then decrypted in the terminal by TermPair, and finally written to the terminal’s input.
Installing
pipx install termpair
OR
pip install termpair
OR, you can run termpair without installing it, Then do the sharing process by running the commands below:
pipx run termpair serve
pipx run termpair share --open-browser
How to use
- Start the TermPair server using command below
termpair serve
- Open a new Terminal window or tab and run this command to share your Terminal
termpair share --host "http://localhost/" --port 8000
TermPair will generate Terminal ID and secret Encryption key to CONNECT as shown above.
- Open your web browser and start connecting through the Web-Browser
- Copy the Terminal ID and Secret Key from the Terminal shell then paste them as shown below then click Connect
As shown above, whatever you type in the Terminal will appear in the browser and vice versa.
So you can type the commands in browser or terminal. The input and output will appear in both windows. This gives full control to anyone that has the session ID.
- If you don’t want to give full control, you can follow the previous steps then use –read-only, or -r option with termpair share command as follows:
termpair share --host "http://localhost/" --port 8000 -r
Make sure TermPair server is started and start the Terminal sharing in read-only mode like below.
AS shown above in the screenshots, I was trying to typing in the Browser shell, but Termpair gave me a warning message that Terminal was shared in read-only mode.
- If you want to open a web browser automatically after you start sharing, use –open-browser, or -b option.
termpair share --host "http://localhost/" --port 8000 -b
- To display the help of TermPair:
termpair share --help
termpair serve --help
Conclusion
That’s it
So in this article, we illustrated how to share and control terminals in real time from Web Browser using TermPair.
For sure, It’s very useful for helping, sharing, viewing and accessing your terminal with anyone you trust.
Thanks