How to connect to SSH from Mac?

SSH access must be enabled for your hosting account (excluding VPS and Dedicated Server) to connect to SSH/SFTP. Contact support to enable SSH access.

Note:
Commands run via SSH can irreparably damage your data, websites, hosting account, and/or server. We strongly recommend that only users with command-line experience use SSH.

 

Step 1: Generate Public and Private Keys in MacOS


  • Run the Terminal app and execute the following command:

    ssh-keygen -t rsa

  • It will ask you to save your keys to /home/user/.ssh/id_rsa. Press Enter.

  • It will ask for a passphrase. Leave it empty.

    Press Enter, and then press Enter again.

    The key should now have been generated.

  • Execute the following command to view the public key:

    cat ~/.ssh/id_rsa.pub

    Copy the public key.

  • Done!

 

Step 2: Authorize the Public Key


To connect to SSH or SFTP, you must authorize your public key.

How to authorize your public key in cPanel and DirectAdmin?

 

Step 3: Connect to SSH in MacOS


  1. Run the Terminal app and execute the following command:

    ssh -p 2022 username@server.example.com

    *Replace username with your cPanel/DirectAdmin username.
    *Replace username with root if you are connecting to a VPS/Dedicated Server as the root user.
    *Replace server.example.com with your server hostname or IP address.

  2. It may ask you to confirm this operation.

    Type "yes" without the quotation marks and press Enter.

  3. Done!

 

Terminal in cPanel/WHM


You can access SSH from cPanel/WHM using your browser without a key pair.

cPanel: Go to cPanel > Advanced > Terminal.
WHM: Go to WHM > Server Configuration > Terminal (requires VPS/Dedicated Server with root access).

 

  • 267 Users Found This Useful
Was this answer helpful?

Related Articles

How to limit the number of FTP connections?

When uploading a large number of files, we recommend you limit the number of FTP connections....

How to upload a large number of files quickly via FTP or File Manager?

Uploading a large number of times usually takes a lot of time. Your computer and server traverse...

How to enable and access SSH?

SSH remains disabled by default on all hosting accounts (excluding VPS and Dedicated Server). If...

How to authorize your public key in cPanel and DirectAdmin?

cPanel and DirectAdmin provide a seamless interface to authorize your public key. Authorizing the...

How to connect to SSH using Command Prompt in Windows?

You need to use key-based authentication in your SSH/SFTP client (the software you are using to...