A powerful web-based SSH client that runs directly in your browser, providing a modern terminal interface for secure remote connections.
- Browser-based SSH Client - No installation required, works in any modern web browser
- Secure WebSocket Connections - Encrypted communication with backend SSH server
- Full Terminal Emulation - XTerm.js provides authentic terminal experience
- Authentication Methods:
- Password authentication
- Public key (SSH) authentication
- Passphrase-protected keys
- TOTP / Two-factor authentication
- Terminal Customization:
- Adjustable font size
- Custom color schemes (foreground/background)
- Multiple terminal types (xterm-256color, linux, vt100, vt220)
- Window title customization
- Connection Management:
- Connection history (stored in localStorage)
- Quick reconnection with saved credentials
- Auto-execute commands on connection
- Multiple SSH key format support (PEM, OpenSSH)
- Responsive Design - Works seamlessly on desktop, tablet, and mobile devices
- Advanced Features:
- Terminal resizing
- Clipboard integration
- Session persistence
- Error handling and reconnection
- Dark mode support
- Modern web browser (Chrome, Firefox, Safari, Edge)
- Backend SSH server or WebSocket-to-SSH bridge
The fastest way to get started with Online Web SSH using Docker:
# Clone the repository
git clone https://github.com/BaseMax/online-web-ssh.git
cd online-web-ssh
# Start with Docker Compose
docker-compose up
# Access the application
# Frontend: http://localhost:8080
# Backend: ws://localhost:8000Stop with Ctrl+C
# Generate SSL certificate (or use existing)
mkdir -p certs
openssl req -x509 -newkey rsa:4096 -keyout certs/key.pem -out certs/cert.pem -days 365 -nodes
# Start production environment
docker-compose -f docker-compose.prod.yml up -d
# Access: https://localhostView logs:
docker-compose logs -f
docker-compose logs backendStop:
docker-compose downSee DOCKER.md for detailed Docker documentation and advanced configurations.
# Clone the repository
git clone https://github.com/BaseMax/online-web-ssh.git
cd online-web-ssh
# Install dependencies
npm install
# Download libraries to static directory
npm run download-libs
# Start development server
npm start-
Clone the Repository
git clone https://github.com/BaseMax/online-web-ssh.git cd online-web-ssh -
Download Required Libraries
Download the following files and place them in their respective directories:
JavaScript Libraries (
static/js/):- jQuery: https://code.jquery.com/jquery-3.6.0.min.js
- Bootstrap Bundle: https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js
- XTerm.js: https://cdnjs.cloudflare.com/ajax/libs/xterm/5.2.1/xterm.min.js
- XTerm Fit Addon: https://cdnjs.cloudflare.com/ajax/libs/xterm/5.2.1/addons/fit/xterm-addon-fit.min.js
CSS Libraries (
static/css/): -
Open in Browser
For testing, you can open
index.htmldirectly in a browser, but you'll need a WebSocket SSH server running. See the Server Setup section.
-
Open the application in your browser
-
Enter the following connection details:
- Hostname/IP Address: SSH server address
- Port: SSH port (default: 22)
- Username: Your SSH username
- Password: Your password (optional)
- Private Key: Upload your SSH key file (optional)
- Passphrase: Key passphrase if encrypted (optional)
-
Click Connect to establish the connection
Expand the "Advanced Options" section to customize:
- Font Size: Adjust terminal text size
- Font Color: Change terminal text color
- Background Color: Change terminal background
- Terminal Type: Select appropriate terminal emulation
- Window Title: Custom title for the session
- Auto-execute Command: Run a command automatically after connection
The application automatically saves your connection details (except passwords and keys) to browser localStorage. Previously used connections can be restored using the "Reset" button or browser history.
- Click on the "Private Key" file input
- Select your SSH private key file (
.pem,.keyformats) - If your key is passphrase-protected, enter the passphrase in the "Passphrase" field
- Click Connect
This is a client-side application (frontend). It requires a WebSocket-to-SSH bridge server (backend) to function.
Included in this repository: We provide a complete Python/asyncio WebSocket SSH bridge.
# Automatically started with docker-compose
docker-compose up
# Backend runs on ws://localhost:8000cd server
pip install -r requirements.txt
python webssh-server.py
# Backend runs on ws://localhost:8000If you prefer different technologies:
- WebSSH (Python/Tornado): https://github.com/huashengyu/webssh
- GateOne (Python): Advanced terminal emulator and SSH client
- Guacamole (Java): Remote desktop gateway
- CloudShell: Various cloud providers offer built-in terminals
┌──────────────────────────────────────────────┐
│ Web Browser (Frontend) │
│ - HTML/CSS/JavaScript │
│ - XTerm.js Terminal │
│ - WebSocket Client │
└─────────────────┬──────────────────────────┘
│
WebSocket Connection
(Encrypted, ws:// or wss://)
│
┌─────────────────▼──────────────────────────┐
│ Backend Server (Required) │
│ - WebSocket Handler │
│ - SSH Client Library (paramiko) │
│ - PTY Management │
│ - Session Lifecycle │
└─────────────────┬──────────────────────────┘
│
SSH Protocol (Port 22)
│
┌─────────────────▼──────────────────────────┐
│ Remote SSH Server │
│ - Linux/Unix/Windows System │
│ - User Authentication │
│ - Shell Environment │
└──────────────────────────────────────────────┘
See server/README.md for:
- Detailed setup instructions
- Configuration options
- Security considerations
- API documentation
- Troubleshooting guide
online-web-ssh/
├── index.html # Main HTML file
├── Dockerfile # Frontend Docker image
├── docker-compose.yml # Development Docker setup
├── docker-compose.prod.yml # Production Docker setup
├── nginx.conf # Nginx reverse proxy config
├── package.json # NPM configuration
├── README.md # Main documentation
├── QUICKSTART.md # Quick start guide
├── CONTRIBUTING.md # Contribution guidelines
├── DOCKER.md # Docker documentation
├── LICENSE # MIT License
├── .gitignore # Git ignore file
├── scripts/
│ └── download-libs.js # Library downloader script
├── static/
│ ├── css/
│ │ ├── style.css # Custom styles
│ │ ├── bootstrap.min.css # Bootstrap framework
│ │ └── xterm.min.css # Terminal emulator CSS
│ ├── js/
│ │ ├── script.js # Main application logic
│ │ ├── jquery.min.js # jQuery library
│ │ ├── bootstrap.bundle.min.js # Bootstrap JS
│ │ ├── xterm.min.js # Terminal emulator
│ │ └── xterm-addon-fit.min.js # Terminal fit addon
│ ├── fonts/ # Custom fonts directory
│ └── img/ # Images and icons directory
└── server/
├── webssh-server.py # Backend WebSocket SSH bridge
├── Dockerfile # Backend Docker image
├── requirements.txt # Python dependencies
└── README.md # Server documentation
If using with a backend server, configure the following:
// In script.js, modify the WebSocket URL construction:
var wsUrl = window.location.href.split(/\?|#/, 1)[0].replace('http', 'ws');Edit static/css/style.css to customize:
:root {
--primary-color: #0d6efd; /* Main color */
--danger-color: #dc3545; /* Error color */
--success-color: #198754; /* Success color */
--warning-color: #ffc107; /* Warning color */
}Modify terminal options in static/js/script.js:
var termOptions = {
cursorBlink: true,
cols: 80,
rows: 24,
fontFamily: "'Courier New', monospace",
fontSize: 14,
theme: {
background: '#000000',
foreground: '#ffffff'
}
};-
Password Handling: Never type passwords on untrusted networks. Use SSH keys instead.
-
Key Files: Your SSH keys are processed entirely in the browser. Never upload keys to untrusted services.
-
Browser Storage: Connection history (without passwords) is stored in browser localStorage. Clear if using public computers.
-
HTTPS: Always use HTTPS/WSS (secure WebSocket) in production.
-
Backend Security: The backend server handling SSH connections should:
- Implement proper authentication
- Use TLS/SSL encryption
- Validate all user inputs
- Log connection attempts
- Implement rate limiting
-
Key Permissions: SSH keys should have proper file permissions:
chmod 600 ~/.ssh/id_rsa
- Chrome/Edge: Latest 2 versions
- Firefox: Latest 2 versions
- Safari: Latest 2 versions
- Mobile: iOS Safari, Chrome Mobile (with limitations)
- Terminal sizes are limited by browser window dimensions
- Some advanced SSH features may not be available
- Audio/video redirection not supported
- X11 forwarding not available
- File transfer requires custom implementation
- Check hostname/IP address is correct
- Verify SSH port is accessible (not blocked by firewall)
- Ensure username and credentials are correct
- Check browser console for error messages (F12)
- Verify browser supports WebSocket (all modern browsers do)
- Clear browser cache and reload
- Check if JavaScript is enabled
- Try a different browser
- Reduce font size
- Decrease terminal size/resolution
- Check network latency to SSH server
- Verify backend server performance
- Click on terminal area to focus it
- Check for browser keyboard shortcuts conflicting
- Verify SSH key permissions if using key auth
- Check if SSH server accepts the key algorithm
The wssh global object provides the following methods:
// Connect with parameters
wssh.connect(hostname, port, username, password, privatekey, passphrase, totp);
// Get current terminal geometry
wssh.geometry();
// Send raw command
wssh.send('ls -la\r');
// Resize terminal
wssh.resize(cols, rows);
// Set terminal colors
wssh.setBgcolor('#000000');
wssh.setFontcolor('#ffffff');
// Set encoding
wssh.setEncoding('utf-8');# Install dependencies
npm install
# Download libraries
npm run download-libs
# Development server
npm run dev
# Build for production
npm run buildContributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement) - Commit changes (
git commit -am 'Add improvement') - Push to branch (
git push origin feature/improvement) - Submit a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Seyyed Ali Mohammadiyeh (MAX BASE)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- WebSSH (Python): Comprehensive SSH client web server
- GateOne (Python): Web-based terminal and SSH client
- XTerm.js: Excellent terminal emulator library
- ParamikoSSH (Python): Pure Python SSH implementation
Seyyed Ali Mohammadiyeh (MAX BASE)
- GitHub: @BaseMax
- Email: maxbasecode@gmail.com
For issues, questions, or suggestions, please:
- Check existing GitHub Issues
- Create a new issue with detailed information
- Contact the maintainers
- Initial public release
- Full SSH client functionality
- XTerm.js integration
- Bootstrap 5 responsive UI
- SSH key and password authentication
- Color and font customization
- Mobile-responsive design
- Dark mode support
- File transfer support (SFTP)
- Session recording and playback
- User authentication for web interface
- Multi-tab support
- Copy/paste history
- Terminal themes library
- Connection profiles/saved sessions
- Docker support
- Terminal sharing capability
- Performance optimization
Made with ❤️ for the open source community
This is a community-driven project. Contributions are welcome and appreciated!