SSH (Secure Shell) gives you command-line access to your server as the root user - useful for editing configuration files, running scripts, inspecting logs, or doing anything that can't be done through WHM or cPanel.

Root is powerful - be careful. As root you can do anything on the server, including things that break it. Don't paste commands you don't understand, keep a backup handy, and if in doubt, ask us before running something destructive.

Connection details

Hostname
Your server's hostname (e.g. yourserver.canspace.ca) or IP address from your setup email.
Port
5622 - we use a non-standard SSH port for security (not the default 22). This is the same on every server, so most SSH brute-force attempts against port 22 hit a closed port and never reach the login prompt.
Username
root
Password
Your server's root password (same as WHM login). We recommend switching to SSH key authentication after your first login - see below.

Connecting from macOS or Linux

Open Terminal (macOS) or any terminal emulator (Linux) and run:

ssh -p 5622 root@your-server-hostname

The first time you connect, you'll be asked to confirm the server's SSH fingerprint - type yes and press Enter. Then enter your root password when prompted. You're in.

Connecting from Windows

Windows 10 and 11 have a built-in OpenSSH client - just open PowerShell or Command Prompt and use the same command as above:

ssh -p 5622 root@your-server-hostname

If you prefer a graphical SSH client, PuTTY is a common choice:

  1. Download and launch PuTTY.
  2. In the Session screen, enter your server hostname or IP in the Host Name field.
  3. Set the Port to 5622.
  4. Leave Connection type on SSH.
  5. Click Open.
  6. Log in as root and enter your password when prompted.

Switching to SSH key authentication (strongly recommended)

Password-based SSH logins are vulnerable to brute-force attacks. SSH key authentication is both more secure and more convenient - no password to type every time.

On macOS or Linux

Generate a key pair (if you don't already have one):

ssh-keygen -t ed25519

Press Enter to accept the default location (~/.ssh/id_ed25519) and optionally set a passphrase for extra security.

Copy the public key to your server:

ssh-copy-id -p 5622 root@your-server-hostname

From then on, ssh -p 5622 root@your-server-hostname will log you in without a password prompt.

On Windows (PowerShell)

  1. Generate a key pair: ssh-keygen -t ed25519
  2. Copy the contents of C:\Users\YourName\.ssh\id_ed25519.pub to the clipboard.
  3. Log in to your server with password SSH once, then append your key to /root/.ssh/authorized_keys:
    echo 'paste-your-public-key-here' >> /root/.ssh/authorized_keys
  4. Set the correct permissions: chmod 600 /root/.ssh/authorized_keys

Disabling password authentication (optional, advanced)

Once key authentication is working reliably, you can disable password-based SSH login entirely to lock out brute-force attempts. Edit /etc/ssh/sshd_config:

PasswordAuthentication no

Then restart SSH: systemctl restart sshd

Test key auth before disabling passwords. If your key isn't set up correctly and you disable password login, you could lock yourself out. Always keep an active SSH session open in a separate window until you've confirmed the new setup works from a fresh connection.

Trouble connecting?

"Connection timed out"
Your IP may be blocked by our firewall after repeated failed attempts, or your local network or ISP may block outbound port 5622. Try from a different network (e.g. phone hotspot) - if it still doesn't work, that rules out your ISP and confirms a firewall block. Once you can reach the server from another network, log in to WHM and unblock your original IP yourself - see Using CSF to unblock, whitelist, and block IPs.
"Permission denied (publickey,password)"
Double-check you're using the right password (from your setup email), and that you're using root as the username (not your cPanel account username).
Looking for shell access inside a cPanel account?
That's different - cPanel users can have their own SSH access enabled via WHM (Account Functions → Manage Shell Access). They'll use their cPanel username, still on port 5622.
Esta resposta foi útil? 0 Utilizadores acharam útil (0 Votos)