Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

assh

amirkabiri0MIT2.0.0

Advanced SSH Manager - A modern CLI tool for managing SSH servers and tunnels

ssh, tunnel, proxy, socks5, vpn, cli

readme

ASSH - Advanced SSH Manager

A modern, single-command SSH server management tool that replaces the legacy shell script system with a clean, organized approach.

Features

  • Server Management: Add, delete, and list SSH servers with ease
  • Multiple Connection Types: SSH, SOCKS5, Sing-box, and Xray support
  • Secure Authentication: SSH key generation and password authentication
  • Beautiful CLI: Colorful output and interactive prompts
  • Cross-platform: Works on macOS, Linux, and Windows with Bun

Installation

Install globally via npm:

npm install -g assh

Now you can use assh from anywhere:

assh ls
assh add
assh ssh myserver

Local Development

  1. Clone the repository:

    git clone <repository-url>
    cd assh
  2. Install dependencies:

    npm install
  3. Make the script executable:

    chmod +x sm.js
  4. Run locally:

    node sm.js ls

Usage

Server Management

Add a Server

assh add

This will prompt you for:

  • Server name (unique identifier)
  • IP address
  • Username (default: root)
  • SSH port (default: 22)
  • Authentication method (generate SSH key, use existing SSH key, or password)
  • SSH key path (if using existing key, default: ~/.ssh/id_rsa)

List Servers

assh ls

Shows a beautiful table with all your servers and their details.

Delete a Server

assh delete

Interactively select and delete a server (includes SSH key cleanup).

Ping a Server

assh ping <server-name>

Test connectivity to a server by pinging its IP address.

Connection Methods

SSH Connection

assh ssh <server-name>

Connects directly to the server via SSH.

SOCKS5 Proxy

assh socks5 <server-name>

Creates a SOCKS5 proxy tunnel. Options:

  • -p, --port <port>: Local port for SOCKS5 proxy (default: 8090)

Example:

assh socks5 myserver -p 8080

Sing-box (Shadowsocks)

assh sing-box <server-name>

Starts sing-box with TUN interface for system-wide VPN.

  • Requires sing-box to be installed
  • Requires sudo privileges for TUN interface
  • Prompts for shadowsocks password

Xray (VLESS)

assh xray <server-name>

Starts Xray with VLESS protocol.

  • Requires xray to be installed
  • Prompts for UUID
  • Provides both SOCKS5 (8090) and HTTP (8091) proxies

Configuration

Server configurations are stored in ~/.server-manager/servers.json. Each server includes:

  • IP address and port
  • Username
  • Authentication method (SSH key path or password)
  • Creation timestamp

Generated SSH keys are stored in ~/.server-manager/ directory with the naming pattern {server-name}_key.

Migration from Legacy System

The new system replaces these legacy scripts:

  • setup.shassh add
  • ssh.shassh ssh <server-name>
  • socks5.shassh socks5 <server-name>
  • sing.shassh sing-box <server-name>
  • xray.shassh xray <server-name>

Dependencies

Required for basic functionality:

  • node (JavaScript runtime, v16+ required)
  • ssh (SSH client)
  • ssh-keygen (SSH key generation)

Optional for advanced features:

  • sshpass (password authentication)
  • sing-box (for sing-box command)
  • xray (for xray command)

Examples

Complete workflow:

# Add a server
assh add

# List servers
assh ls

# Ping a server
assh ping myserver

# Connect via SSH
assh ssh myserver

# Create SOCKS5 proxy
assh socks5 myserver -p 8080

# Start sing-box VPN
assh sing-box myserver

# Start Xray proxy
assh xray myserver

Adding a server with SSH key:

assh add
# Follow prompts:
# - Server name: myserver
# - IP: 1.2.3.4
# - Username: root
# - Port: 22
# - Auth: Generate SSH Key (or Use existing SSH Key)
# - Key path: ~/.ssh/id_rsa (if using existing key)
# - Install key: Yes (if generating new key)
# - Password: [your-server-password] (if installing new key)

Security

  • SSH keys are automatically generated using RSA 2048-bit encryption
  • Keys are stored locally in the ./servers/ directory
  • Password authentication is supported but SSH keys are recommended
  • All SSH connections use StrictHostKeyChecking=no for convenience

Troubleshooting

Common Issues:

  1. Permission denied (publickey):

    • Make sure the SSH key was properly installed on the server
    • Check if the server allows SSH key authentication
  2. Connection refused:

    • Verify the server IP and port are correct
    • Check if the SSH service is running on the server
  3. sing-box/xray not found:

    • Install the required tools first
    • Make sure they're in your PATH

Getting Help:

assh --help
assh <command> --help

License

MIT License - feel free to modify and distribute.