Skip to content

JeanSebastienBash/WebTerminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web Terminal

Node.js License Terminal

A real Linux terminal in your browser. Full bash profile, aliases, and environment variables loaded. Hostname and username masked for screencasts and demos.

Features

  • Real bash shell — Interactive PTY via node-pty
  • Full profile loading.bashrc, .bash_profile, .bash_aliases loaded automatically
  • Identity masking — Fake username and hostname in prompt for privacy
  • xterm.js UI — Modern, responsive terminal emulator
  • WebSocket — Real-time bidirectional communication
  • Configurable — Environment variables for customization

Installation

git clone https://github.com/JeanSebastienBash/WebTerminal.git
cd WebTerminal
npm install

Configuration

Copy .env.example to .env and customize:

cp .env.example .env

Edit .env:

PORT=3000
FAKE_USERNAME=dev
FAKE_HOSTNAME=workstation

Usage

Development

npm run dev

Production

npm start

Open your browser to http://localhost:3000

Stopping the Server

To stop the server and release resources:

# If running with npm start / npm run dev
Ctrl+C

# Or force kill if needed
pkill -f "node.*server"

How It Works

  1. Browser connects via WebSocket
  2. Server spawns a bash PTY with your home directory
  3. Your bash profile is sourced (.bashrc, .bash_profile, .bash_aliases)
  4. Prompt is overridden with masked identity
  5. All commands execute in your real shell with full access to your environment

Requirements

  • Node.js >= 18.0.0
  • Linux/macOS (for node-pty support)
  • Bash shell

Security Notes

⚠️ This runs commands on your actual system. Use with caution:

  • Only run on trusted networks
  • Consider adding authentication for production use
  • Never expose publicly without security measures

Project Structure

WebTerminal/
├── src/
│   └── server.js          # Express + WebSocket server
├── public/
│   ├── lib/               # xterm.js bundles
│   └── index.html         # Terminal UI
├── .env.example          # Configuration template
├── .gitignore
├── LICENSE
├── package.json
└── README.md

License

MIT License — see LICENSE file


Made by DreamprojectAI

About

A full Linux terminal in your browser with interactive bash, auto-loaded profiles, masked username/hostname for privacy, and a modern xterm.js UI.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors