Skip to content

billchurch/webssh2_client

Repository files navigation

WebSSH2 Client - Web SSH Client

Orthrus Mascot

WebSSH2 Client is an HTML5 web-based terminal emulator and SSH client component. It uses WebSockets to communicate with a WebSSH2 server, which in turn uses SSH2 to connect to SSH servers.

WebSSH2 demo

Important Notice

This package contains only the browser-side client component of WebSSH2. It requires a compatible WebSSH2 server to function. The server component is available at webssh2 server. This package is intended for advanced users who want to customize or integrate the client component independently.

Status

This is an experimental refactor of the WebSSH2 v0.2.x client to function as a standalone component. It has been separated from the server-side code to facilitate customization and integration with different frameworks.

Requirements

  • Modern web browser with JavaScript enabled
  • Compatible WebSSH2 server instance (v0.2.x or compatible)
  • Socket.IO v2.2.0 compatibility (due to server requirements)

Installation

  1. Clone the repository:

    git clone https://github.com/billchurch/webssh2_client.git
    cd webssh2_client
    
  2. Install dependencies:

    npm install
    
  3. Build the client:

    npm run build
    
  4. The built client files will be in the client/public directory.

Server Requirements

The WebSSH2 client requires a compatible server that provides:

  • WebSocket endpoint for SSH communication
  • Authentication handling
  • SSH connection management
  • Socket.IO v2.2.0 compatibility

For server setup instructions, refer to the WebSSH2 server documentation.

Client Features

  • Web-based SSH client with xterm.js terminal emulation
  • Customizable terminal settings:
    • Font size and family
    • Color schemes
    • Cursor behavior
    • Scrollback buffer size
  • Session logging with download capability
  • Copy and paste functionality
  • Terminal mouse support
  • Keyboard shortcuts
  • Responsive design
  • Multi-factor authentication support (when supported by server)
  • Support for credential replay and reauthentication

Configuration

The client can be configured through:

  1. URL parameters
  2. Configuration object
  3. User interface settings

URL Parameters

Supported URL parameters include:

  • host - SSH server hostname
  • port - SSH server port (default: 22)
  • header - Optional header text
  • headerBackground - Optional header background color
  • sshterm - Terminal type (default: xterm-color)

Configuration Object

You can configure the client by setting window.webssh2Config:

window.webssh2Config = {
  socket: {
    url: null,  // WebSocket URL (auto-detected if null)
    path: '/ssh/socket.io'  // Socket.IO path
  },
  ssh: {
    host: null,  // SSH server hostname
    port: 22,    // SSH server port
    username: null,
    sshterm: 'xterm-color'
  },
  header: {
    text: null,
    background: 'green'
  },
  autoConnect: false
};

Development

Support

If you find this project helpful, consider supporting the developer:

Buy Me A Coffee

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published