Development and databases
Accessing your account over SSH
SSH lets you manage your hosting's files and run its tools over an encrypted connection. It is useful for Git, Composer, imports and tasks that need a terminal. Commands run with your hosting account's permissions.
Remember that SSH access must be enabled in the hosting service options available in the client area.
Terminal built into cPanel
cPanel includes a built-in terminal, which makes access easier if you do not want to set up an SSH client.
Connecting to your account over SSH
If you are just getting started with the terminal or will only use it occasionally, we recommend the terminal built into cPanel.
How you connect depends on your operating system; the steps for each case are below.
- The usual SSH port at Hostsuar is 93. Check your service's details; a different port is no substitute for authentication with a protected key.
Windows
Download PuTTYgen from its official website:
In PuTTYgen, generate a key of type EdDSA with curve Ed25519, protect it with a long, unique passphrase and save the .ppk private key on your computer only. Copy the public key, go to cPanel, SSH Access section → Manage SSH Keys, import it and click Manage Authorization to authorise it. Never upload or send the private key.
Finally, open PuTTY and go to Connection → SSH → Auth → Credentials. In Private key file for authentication, click Browse and select the private key you saved with PuTTYgen.
Now go to Session and change the port to 93, enter in Host Name the server name shown in the hosting's technical details and then click Open. Before accepting the alert, compare the fingerprint shown with the server's fingerprint obtained through an independent, trusted channel; never click Yes without checking it. Then enter your cPanel username and the key's passphrase. You can load the key into Pageant so you do not have to type the passphrase on every connection, without leaving it saved in sessions or scripts.
Linux and macOS
Open the terminal or console on your computer and run the following command to generate the public and private keys (if you do not already have them):
ssh-keygen -t ed25519 -a 100
If a key already exists at the suggested path, do not overwrite it: choose another name and use that path in the following commands. Enter a long, unique passphrase when asked. When it finishes, it will have created two files in the .ssh directory: id_ed25519 and id_ed25519.pub; the first is the private key and must never leave your computer, and the second is the public key.
It is this public key that you need to "upload" to your hosting account so the SSH service lets you log in with that identity. The passphrase protects the private key and is different from your cPanel password.
Go to cPanel, "SSH Access" section, and click "Manage SSH Keys"
Go to Import Key and paste the contents of id_ed25519.pub into "Paste the public key into the following text box:"
Go back to the previous page and you will see the imported key in the list; click Manage Authorization to authorise that key.
If you do not already have an agent available in the session, you can start one with the first command. Then add the key so the passphrase is not typed into commands or saved in scripts:
eval "$(ssh-agent -s)" ssh-add "$HOME/.ssh/id_ed25519"
Before the first connection, get the fingerprint of the server's key through an independent, trusted channel. Compare that fingerprint with the one the SSH client shows and cancel if it does not match; do not answer yes blindly. You can then connect:
ssh -p 93 -i "$HOME/.ssh/id_ed25519" usuario_cpanel@servidor.example.com
Possible errors
- All the steps work, you manage to log in, but the following message appears:
Shell access is not enabled on your account! If you need shell access please contact support.
In this case Shell access is disabled; you can enable SSH access from the client area.
- Nothing appears when I type the password.
The terminal shows no characters or asterisks when you enter a password or passphrase. Type it and press Enter; you will be logged in if the authentication is valid.
Other common errors
- Timeout or Connection refused: check the host, the port and your network's outbound access. A domain behind Cloudflare may not route SSH to the hosting server.
- Permission denied (publickey): check the cPanel username, the private key selected and the authorisation of its public part. Importing it does not always authorise it automatically.
- REMOTE HOST IDENTIFICATION HAS CHANGED: confirm with support whether the server's key has changed before editing
known_hosts.
To leave, use exit. If you stop using a key or lose the computer, revoke its authorisation in cPanel. Changing the cPanel password does not on its own revoke an authorised public key.
You may also find useful
- Open and use the cPanel built-in terminal Open the web terminal built into cPanel to work on the command line without setting up an SSH client...
- Apache handlers Set from cPanel which Apache handler should process a given extension, and learn why this option cal...
- Automatic deployment from GitHub, GitLab or Bitbucket with instant rollback Connect a Git repository to your hosting, run per-release scripts with deployment and .env variables...
- Automating Git deployment tasks with the .cpanel.yml file Define deployment tasks in .cpanel.yml, run them after a push or pull and learn how to trigger the p...
Something wrong or out of date? Tell us and we will review it.