How to Connect a Website via SSH with StackCP

Author:

Published:

Updated on August 15, 2024

Reading Time: 4 min

StackCP SSH #

SSH, or ‘Secure Shell,’ allows for secure remote access to your website files, configuration changes, and remote command execution within your file space. With StackCP, SSH connections are encrypted and protected using either 2FA or public/private key pairs, ensuring secure and reliable access. Below are instructions for connecting to your site via SSH for Windows, macOS, and Linux devices using public/private key pairs.

Note: #

  • Connect via SSH only if you’re familiar with the command line interface.
  • If your SSH connection closes immediately, your account may be blocked for unauthorized Sudo use. Please contact support for assistance at CP CLOUD HOSTING.

Windows #

  1. Download an SSH Client:
    • Download PuTTY, a free SSH client for Windows, from the official PuTTY website.
  2. Generate a Public Key:
    • Open PuTTY Key Generator.
    • Click Generate and move the mouse around in the grey box to create randomness.
    • Add a passphrase (password) for the key.
  3. Add Public Key to StackCP:
    • Log in to StackCP, go to Manage Hosting, and select the package for SSH access.
    • Navigate to SSH Access under the Security section.
    • Paste the generated public key from PuTTYgen into the Public Key box and click Add Public Key.
  4. Save the Private Key:
    • Save the private key in PuTTYgen.
  5. Configure PuTTY:
    • Open PuTTY.
    • Under SSH, go to Auth and Credentials.
    • Browse to the saved private key file.
    • Return to Session and enter the hostname:
      • UK data center: ssh.gb.stackcp.com
      • US data center: ssh.us.stackcp.com
    • Click Open.
  6. Login via Command Line:
    • Enter your domain as the username (e.g., domain.co.uk).
    • Enter the passphrase you set earlier.

macOS #

  1. Generate a Public Key:
    • Open Terminal.
    • Enter ssh-keygen and follow the prompts to generate a key pair.
    • Note the file path of the public key (e.g., /Users/yourusername/.ssh/id_rsa.pub).
  2. Add Public Key to StackCP:
    • Log in to StackCP, go to Manage Hosting, and select the package for SSH access.
    • Navigate to SSH Access under the Security section.
    • View the public key using cat /Users/yourusername/.ssh/id_rsa.pub in Terminal.
    • Copy and paste the public key into the Public Key box in StackCP and click Add Public Key.
  3. Connect via Terminal:
    • Enter the SSH command:
      • For UK data center: ssh yourdomain.com@ssh.gb.stackcp.com
      • For US data center: ssh yourdomain.com@ssh.us.stackcp.com
    • Confirm the connection by typing yes.

Linux #

  1. Generate a Public Key:
    • Open Terminal.
    • Navigate to the desired directory and enter ssh-keygen.
    • Follow the prompts to generate a key pair.
  2. Add Public Key to StackCP:
    • Log in to StackCP, go to Manage Hosting, and select the package for SSH access.
    • Navigate to SSH Access under the Security section.
    • View the public key using cat yourkeyname.pub in Terminal.
    • Copy and paste the public key into the Public Key box in StackCP and click Add Public Key.
  3. Connect via Terminal:
    • Enter the SSH command:
      • For UK data center: ssh -i yourkeyname ssh.gb.stackcp.com
      • For US data center: ssh -i yourkeyname ssh.us.stackcp.com
    • Confirm the connection by typing yes.

How to Connect a Website via SSH #

SSH, or ‘Secure Shell,’ allows for secure remote access to your website files, configuration changes, and remote command execution within your file space. With StackCP, SSH connections are encrypted and protected using either 2FA or public/private key pairs, ensuring secure and reliable access. Below are instructions for connecting to your site via SSH for Windows, macOS, and Linux devices using public/private key pairs.

Note: #

  • Connect via SSH only if you’re familiar with the command line interface.
  • If your SSH connection closes immediately, your account may be blocked for unauthorized Sudo use. Please contact support for assistance at CP CLOUD HOSTING.

Windows #

  1. Download an SSH Client:
    • Download PuTTY, a free SSH client for Windows, from the official PuTTY website.
  2. Generate a Public Key:
    • Open PuTTY Key Generator.
    • Click Generate and move the mouse around in the grey box to create randomness.
    • Add a passphrase (password) for the key.
  3. Add Public Key to StackCP:
    • Log in to StackCP, go to Manage Hosting, and select the package for SSH access.
    • Navigate to SSH Access under the Security section.
    • Paste the generated public key from PuTTYgen into the Public Key box and click Add Public Key.
  4. Save the Private Key:
    • Save the private key in PuTTYgen.
  5. Configure PuTTY:
    • Open PuTTY.
    • Under SSH, go to Auth and Credentials.
    • Browse to the saved private key file.
    • Return to Session and enter the hostname:
      • UK data center: ssh.gb.stackcp.com
      • US data center: ssh.us.stackcp.com
    • Click Open.
  6. Login via Command Line:
    • Enter your domain as the username (e.g., domain.co.uk).
    • Enter the passphrase you set earlier.

macOS #

  1. Generate a Public Key:
    • Open Terminal.
    • Enter ssh-keygen and follow the prompts to generate a key pair.
    • Note the file path of the public key (e.g., /Users/yourusername/.ssh/id_rsa.pub).
  2. Add Public Key to StackCP:
    • Log in to StackCP, go to Manage Hosting, and select the package for SSH access.
    • Navigate to SSH Access under the Security section.
    • View the public key using cat /Users/yourusername/.ssh/id_rsa.pub in Terminal.
    • Copy and paste the public key into the Public Key box in StackCP and click Add Public Key.
  3. Connect via Terminal:
    • Enter the SSH command:
      • For UK data center: ssh yourdomain.com@ssh.gb.stackcp.com
      • For US data center: ssh yourdomain.com@ssh.us.stackcp.com
    • Confirm the connection by typing yes.

Linux #

  1. Generate a Public Key:
    • Open Terminal.
    • Navigate to the desired directory and enter ssh-keygen.
    • Follow the prompts to generate a key pair.
  2. Add Public Key to StackCP:
    • Log in to StackCP, go to Manage Hosting, and select the package for SSH access.
    • Navigate to SSH Access under the Security section.
    • View the public key using cat yourkeyname.pub in Terminal.
    • Copy and paste the public key into the Public Key box in StackCP and click Add Public Key.
  3. Connect via Terminal:
    • Enter the SSH command:
      • For UK data center: ssh -i yourkeyname ssh.gb.stackcp.com
      • For US data center: ssh -i yourkeyname ssh.us.stackcp.com
    • Confirm the connection by typing yes.

Additional Tips: #

  • Ensure you enter the correct passphrase when prompted.
  • Use tools like PuTTY or Terminal to manage your SSH connections efficiently.
  • If you encounter issues, contact CP CLOUD HOSTING support for assistance.