Skip to main content

To connect to your CPanel hosted server via SSH OSX, please follow these steps:

Generate your SSH key
  • Log in to your CPanel account.  As first you will have to generate an SSH key pair in cPanel -> SSH/Shell Access
  • Complete the details in the Generate new SSH key pair form
    • First name
    • Last name
    • Email
    • Password - take note of the password you used to generate the key as you will use it shortly
    • Allowed IP address 
  • Copy the private key from cPanel and save it into a text file on your OSX
  • Load the private key into your SSH-agent using your Terminal using the ssh-add command:
ssh-add /Users/yourname/ssh_private_key
  • Make sure that you replace /Users/yourname/ssh_private_key with the location of your private key text file.  For me I created a directory related to the server I was accessing and placed the key there.
  • You will be prompted to type in the key's password. You need to type the same password that you have placed while generating your keys in cPanel.

You can connect via SSH. To connect, use the following command in your Terminal:

ssh user@hostname -pport

Where you replace user, hostname and port with the following:

  • user - the user for which you want to establish the SSH connection
  • hostname (or IP address) - here you should enter the host/IP of the server to which you wish to connect
  • port - the port for the connection - here you should enter 18765

To illustrate this if your cPanel username is bwgace and you are hosted on the example.com server you should execute the following command:

ssh bwgace@example.com -p18765

If successful, you will have established a SSH connection with your dedicated server.

Related articles

Andrew Fletcher15 Apr 2025
Fine-tuning Fail2Ban to stop Apache bogus FCGI attacks
Building a resilient web server Early in the year, we encountered a number of challenges, one of the most disruptive was a sustained wave of automated attacks hammering several of the web servers we manage. The volume of traffic overwhelmed server resources, slowing websites to a crawl and...
Andrew Fletcher08 Apr 2025
How smart blocking protects your digital infrastructure
Across every industry, the operational risks of cyber threats are escalating. Automated bots, denial-of-service attacks and vulnerability scanners are increasingly common. For businesses operating in Australia and globally, implementing resilient, proactive security measures is essential to ensure...
Andrew Fletcher02 Mar 2021
Is your Linux computer running slow?
Well for me it is very slow.  Recently, I upgraded from CentOS 6 to Centos 7.  CentOS 6 was lightening fast.  Since the upgrade CentOS 7 has been so slow in comparison.  But when I say slow, it has been appallingly slow.  It just was unable to reach anywhere the...