Back to Shared Hosting Documentation

    SSH Access

    Command-line access to your hosting account for advanced management.

    What is SSH?

    SSH (Secure Shell) provides secure command-line access to your hosting account. It allows you to execute commands, manage files, and perform advanced server tasks directly from your computer.

    Note: SSH access may not be available on all shared hosting plans. Check your hosting plan features or contact support to verify SSH is enabled for your account.

    SSH Connection Information

    You'll need:

    • Hostname: yourdomain.com or server hostname
    • Port: 22 (default SSH port)
    • Username: Your cPanel username
    • Password: Your cPanel password (or SSH key)

    Connecting via SSH

    On Linux/Mac

    Open Terminal and run:

    ssh username@yourdomain.com

    Or with specific port:

    ssh username@yourdomain.com -p 22

    On Windows

    Windows 10/11 (Built-in SSH):

    Open Command Prompt or PowerShell and run the same command as Linux/Mac.

    PuTTY (Traditional Method):

    1. Download PuTTY from putty.org
    2. Install and open PuTTY
    3. Enter hostname: yourdomain.com
    4. Port: 22, Connection type: SSH
    5. Click "Open"
    6. Enter username and password

    SSH Key Authentication

    More secure than password authentication:

    Step 1: Generate SSH Key Pair

    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
    • • Save to default location (~/.ssh/id_rsa)
    • • Enter passphrase (optional but recommended)
    • • Creates two files: id_rsa (private) and id_rsa.pub (public)

    Step 2: Upload Public Key to cPanel

    1. cPanel → SSH Access → Manage SSH Keys
    2. Click "Import Key"
    3. Paste contents of id_rsa.pub
    4. Give it a name and click "Import"
    5. Click "Manage" next to imported key
    6. Click "Authorize"

    Step 3: Connect with Key

    ssh -i ~/.ssh/id_rsa username@yourdomain.com

    No password required (unless key has passphrase).

    Basic SSH Commands

    Navigation

    pwd                # Print working directory
    ls                 # List files
    ls -la             # List files with details
    cd directory/      # Change directory
    cd ..              # Go up one directory
    cd ~               # Go to home directory

    File Management

    cp file.txt backup.txt    # Copy file
    mv file.txt newname.txt   # Move/rename file
    rm file.txt               # Delete file
    rm -r directory/          # Delete directory
    mkdir newfolder           # Create directory
    touch newfile.txt         # Create empty file

    Viewing Files

    cat file.txt        # Display entire file
    less file.txt       # View file with pagination
    head file.txt       # Show first 10 lines
    tail file.txt       # Show last 10 lines
    tail -f error.log   # Follow log file (real-time)

    File Permissions

    chmod 644 file.txt           # Change file permissions
    chmod 755 directory/         # Change directory permissions
    chown user:group file.txt    # Change ownership

    Archives

    tar -czf backup.tar.gz directory/    # Create compressed archive
    tar -xzf backup.tar.gz                # Extract archive
    zip -r archive.zip directory/         # Create zip file
    unzip archive.zip                     # Extract zip

    Managing WordPress via SSH

    # Navigate to WordPress
    cd ~/public_html
    
    # Update WordPress Core
    wp core update
    wp core verify-checksums
    
    # Plugin Management
    wp plugin list
    wp plugin update --all
    wp plugin activate plugin-name
    wp plugin deactivate --all
    
    # Database Operations
    wp db export backup.sql
    wp db import backup.sql
    wp db optimize

    File Transfer via SSH

    SCP Commands:

    # Upload file
    scp localfile.txt username@yourdomain.com:~/public_html/
    
    # Download file
    scp username@yourdomain.com:~/file.txt ./
    
    # Upload directory
    scp -r localdirectory/ username@yourdomain.com:~/public_html/

    SFTP (Interactive):

    sftp username@yourdomain.com
    put localfile.txt              # Upload
    get remotefile.txt             # Download
    exit                           # Exit SFTP

    Security Best Practices

    Authentication

    • • Use SSH keys instead of passwords
    • • Add passphrase to SSH keys
    • • Never share private key
    • • Use unique SSH key per device

    Connection Security

    • • Don't use SSH on public WiFi without VPN
    • • Keep SSH client updated
    • • Log out when finished
    • • Monitor login attempts

    Server Security

    • • Don't run commands you don't understand
    • • Backup before making changes
    • • Check file permissions carefully
    • • Don't store sensitive data in home directory

    Common SSH Errors

    "Permission Denied"

    • • Wrong username or password
    • • SSH not enabled for account
    • • IP blocked after failed attempts
    • • SSH key not properly configured

    "Connection Refused"

    • • Wrong port (check if it's 22)
    • • Firewall blocking connection
    • • SSH service not running

    "Host Key Verification Failed"

    Server fingerprint changed. Remove old key:

    ssh-keygen -R yourdomain.com

    Reconnect and accept new key.

    Limitations on Shared Hosting

    • • Restricted commands for security
    • • Can't install global software
    • • Can't modify server configuration
    • • Resource limits apply
    • • Can't run persistent background processes
    • • Some system commands unavailable

    SSH Tips

    • • Up arrow: Previous command
    • • Ctrl+R: Search command history
    • • Tab: Autocomplete file/directory names
    • • Ctrl+C: Cancel current command
    • exit or Ctrl+D: Close SSH session
    • man command: View manual for any command