🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

SSH Server

by @xingfalin

SSH remote connection and operation for servers (Linux/Unix cloud servers, etc.)

Versionv1.0.0
Downloads781
TERMINAL
clawhub install ssh-server

πŸ“– About This Skill


name: ssh-server description: SSH remote connection and operation for servers (Linux/Unix cloud servers, etc.) read_when: - User needs SSH connection to remote server - Need to view/operate remote server - Need to query server status, logs - Need to execute commands on server metadata: {"emoji":"πŸ–₯️","requires":{"bins":["ssh"]}} allowed-tools: Bash(ssh:*)

SSH Server - Remote Server Management

Overview

Connect to and operate remote Linux/Unix servers via SSH.

Security Notes

⚠️ Important: Protect Sensitive Info

  • Never send passwords directly in chat
  • Passwords are encrypted and stored locally
  • Prefer SSH key authentication
  • Initial Setup

    1. Install Dependencies

    SSH client is usually pre-installed:

  • Windows: C:\Windows\System32\OpenSSH\ssh.exe (Win10/11θ‡ͺεΈ¦)
  • Linux/Mac: Terminal built-in
  • 2. Add Server Config

    Method A: Interactive Add (Recommended)

    Run this in your local terminal:

    python D:\openClaw\openclaw\config\ssh_config.py add
    

    Then enter:

  • Server name: e.g., vps, ubuntu, digitalocean
  • Server IP: xxx.xxx.xxx.xxx
  • Port: 22
  • Username: root, ubuntu, etc.
  • Password: (hidden during input, stored securely)
  • Method B: SSH Key Login (More Secure)

    # 1. Generate local SSH key (if not exists)
    ssh-keygen -t ed25519

    2. Copy public key to server

    ssh-copy-id user@your-server-ip

    Connect to Server

    Interactive Connect (Password)

    Run in your terminal:

    ssh -o StrictHostKeyChecking=no user@your-server-ip
    

    Then enter password manually.

    Connect Using Config Alias

    Run in your terminal:

    python D:\openClaw\openclaw\config\ssh_config.py connect 
    

    System will prompt for password, then connect.

    Server Operations

    After connecting, you can execute:

    System Status

    # System overview
    uptime

    Memory usage

    free -h

    Disk usage

    df -h

    CPU info

    lscpu

    Full system info

    uname -a && uptime && free -h && df -h

    Users and Processes

    # Online users
    who

    Process list

    ps aux

    Processes sorted by memory

    ps aux --sort=-%mem

    Find specific process

    ps aux | grep nginx

    Network Status

    # Network connections
    ss -tuln

    Port usage

    netstat -tuln

    Service Management

    # Check service status
    systemctl status nginx

    Start service

    sudo systemctl start nginx

    Stop service

    sudo systemctl stop nginx

    Restart service

    sudo systemctl restart nginx

    Log Viewing

    # System logs
    sudo journalctl -xe

    Last 100 lines

    sudo journalctl -n 100

    Specific service logs

    sudo journalctl -u nginx

    Real-time log

    tail -f /var/log/syslog

    Docker Operations

    # Running containers
    docker ps

    All containers

    docker ps -a

    Container logs

    docker logs container_name

    Enter container

    docker exec -it container_name bash

    Config File

    Server configs saved to D:\openClaw\openclaw\config\servers.json (passwords encrypted).

    {
      "vps": {
        "host": "xxx.xxx.xxx.xxx",
        "port": 22,
        "username": "root",
        "key_file": null,
        "password_encrypted": "gAAAAAB..."
      }
    }
    

    Management Commands

    # Add server
    python config/ssh_config.py add

    List servers

    python config/ssh_config.py list

    Connect to server

    python config/ssh_config.py connect

    Delete server

    python config/ssh_config.py delete

    Usage Flow

    1. User tells AI: Want to connect to my VPS 2. AI prompts user: Run python config/ssh_config.py add in terminal 3. After user adds: AI can connect to server via config 4. Connection methods: - Password: User runs ssh user@IP and enters password - Key: Direct connect after config

    Security Principles

  • πŸ” Passwords not transmitted via chat
  • πŸ”‘ Prefer SSH keys
  • πŸ›‘οΈ Passwords encrypted locally
  • ⚠️ Confirm before dangerous operations