In this tutorial:

Your shared hosting account gives you the ability to connect to an account via SSH, but you must connect using SSH Keys, which is different than the procedure for VPS and Dedicated servers. If you are using a reseller hosting account this guide we will show you how to connect to a individual cPanel account via SSH. Shared server accounts also use the same process to access SSH. First you must generate an SSH key, then convert and download it, and finally connect using an SSH client such as Putty.

Note: While shared servers now have SSH access capability, our large disk servers, known as ld servers, do not have this capability. If your server name takes the format ld###, then you are on a large disk server and unable to use SSH.

How to Generate an SSH Key

Reseller Accounts only: Before following this guide, make sure you have enabled SSH for the cPanel you are connecting to.

  1. Login to the cPanel that you want to connect to using SSH.
  2. Under Security click SSH/Shell Access.
  3. Click the Manage SSH Keys button, then click in the field labeled Generate a new Key.
  4. Type in a strong password, then click in the field below it and type the password again.
    creating a key
  5. Click the Generate Key button, then you will see a Key Generation Complete! message. Click the Go Back button.
  6. On the next screen click Manage Authorization.
  7. You will see a message stating “The key with the name "id_dsa" (this name may differ based on your settings) is currently not authorized for use to connect to this account. You can change this by clicking here:” Click the Authorize button. You will then see a message stating “The key “” has been authorized.

Download and Convert the SSH Key

  1. Download and install puttygen.
  2. Login to the cPanel that you want to connect to using SSH.
  3. Under Security click SSH/Shell Access.
  4. Click the Manage SSH Keys button.
  5. Under Private Keys click View/Download next to the Private key you want to use.
  6. On the next screen click the Download Key button.
  7. Open puttygen, and click the Load button.
  8. Click the PuTTY Private Key Files(*.ppk) drop-down menu, annd change it to All Files(*.*). Then, select the id_dsa file you just downloaded, and click the Open button.
    Choose the Private Key
  9. A box will pop-up asking for your Passphrase. Enter the password for your key, and click OK.
    Input password
  10. You will see a message stating "Successfully imported foreign key," click the OK button.
    Puttygen notification
  11. Now click the Save private key button to download your private key file.
    Download your Private Key in puttygen

SSH using Putty

  1. Open Putty, under Connection click SSH, then Auth.
    authorizing putty
  2. Click Browse under Private key file for authentication, then select the private key you downloaded in the last section, and click Open.
  3. Click Session and under port enter: 2222
  4. For the Host Name, enter your domain name, or shared IP address,then click the Open button to connect. If you see a PuTTY Security Alert, click Yes.
    Host key is not cached message
  5. You will see "Login As". Please enter your cPanel username and then hit Enter.
  6. Then, enter the password for your key file and hit enter. For security reasons, PuTTY will not show anything when you type your password, this is normal. You will then be logged into your account via SSH.

Congratulations, now you know how to connect to a Shared server or Reseller cPanel account using SSH! Click here for more information on SSH Hosting

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Support Center Login

Social Media Login

Related Questions

Here are a few questions related to this article that our customers have asked:
Establish remote connection to PostGreSQL database
Can't Generate Private Key
Can I use shared hosting SFTP port 2222 to perform migrations?
How do I get into a blocked Command Prompt?
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2014-06-05 12:44 am

my password got !@#& simbol,in the PuTTY said -bash: !@#& event not found.

11,156 Points
2014-06-05 8:55 am
Passwords are perfectly fine to have a symbol. We actually encourage it. If you are connecting to a reseller account as described within the article, you will be connecting via a reseller key and not the password itself. Have you successfully generated a key and added it to Putty?
n/a Points
2014-06-05 9:27 am

Ok, about the generator key. when I click on the password generator, pop-up box appears just barely missing a second later. I only managed to print screen to copy the password and could not mark the small box and click on the use password button.

11,156 Points
2014-06-05 9:44 am
It sounds like you have something going on in your browser that is causing that issue. Try clearing your browser cache or using another browser.
n/a Points
2014-06-27 5:53 pm

How can I connect to my shared hosting shell via SSH on a Mac or Linux machine?

20,728 Points
2014-06-27 8:40 pm
Hello Ironstone,

This is possible now, since SSH access is available on Shared Hosting accounts. You will need to login to your cPanel and then generate a private key that you will be uploading to your Mac.

  1. Login to the cPanel and then go to the SSH/Shell Access icon. Click on it to access section where you can generate the private key.

  2. Click on the button labeled Manage SSH Keys

  3. Click on the button labeled Generate a new key

  4. Type in a password (do NOT use the password generator - it does not work properly), then confirm it. Make sure to write down the password you used. Leave the key type at DSA and key size at 1024.

  5. Click on the Generate Key button.

  6. You should then see a confirmation that the key was generated. Return to the Manage SSH Keys screen

  7. You should see the Public key AND the Private key generated with the name "id_dsa". Click on View/DownloadPRIVATE key. This is the key that you will need to load onto your Mac.

  8. Download the file to your Mac client. To make my instructions a little easier. Simply copy it to your desktop

  9. Before we move to the Mac side of things, we need to complete one more task (which drove me crazy when I was trying to figure this out earlier). You should see that the PUBLIC key has an authorization status of NOT AUTHORIZED. Click on the Manage Authorization link. This will authorize the key for you! NOTE: If you don't authorize this key, it doesn't matter what you do on the Mac side, you won't be able to login, and you'll scratch your head and scream at your screen for several minutes like I did.

  10. Okay... on to your Mac. Login to your TERMINAL program. If you don't know how to do this, go the magnifying glass in the OS toolbar (usually at the top right - this is Spotlight) and type in "terminal". You should see Terminal appear as an application. Select it and it will launch. Before I go on, you do need to be logged into your Mac as the administrator otherwise you will not be able to make these changes.

  11. To make things easy, simply switch to your desktop - which is where the ID_DSA file should be located. The terminal command is: cd desktop

  12. Make sure that the ID_RSA file is already on your desktop. Then type the following into your terminal:

    cp -frp id_dsa ~/.ssh

    This will copy the key into the .ssh folder.

  13. Next run the following command to add the identity to your computer.

    ssh-add -K id_dsa

    You will then need to type in the password you used to generate the key in cPanel.

  14. You should see a confirmation that the identity has been added to your Mac. When this is complete, then you should be able to use the SSH command to login to the server. The cPanel user name will need to be used along with the server name. The command will look like this:


    (here's an example: ssh
  15. If this is the first time you have connected the server, you may see a message stating that it can't identity server. Just click on "YES" to proceed (just make you're connecting to the right server). The password should automatically work and you should see the terminal connect.

Thanks for asking this question. I was actually working on this information before and writing an article for our support center for it, but I was never able to finish it until now. Let us know if you still have any problems. By the way, when I was testing this (deleting the key and starting over several times), I was using a MacBook Pro running the latest version of Mavericks. If you're running some version of OSX, then it should also work.

Arnel C.
n/a Points
2014-06-28 6:29 pm

Hi Arnel,


Thanks for the detailed explanation. I have followed each and every step exactly but the problem is I am not able to connect to the shell. I tried even with putty as explained in

It says connection timeout in putty and in my mac terminal, it also gives connection timeout. What might be the problem? Thanks!

23,312 Points
2014-06-29 8:03 am
Hello ironstone,

It is possible that the SSH is not yet enabled on your shared server. To my knowledge the rollout was slightly gradual. If you have tried all the instructions, this may be the case. You will want to contact Live Support to have them check your specific server to be sure. Very soon, however, all shared servers will support SSH.

Kindest Regrds,
Scott M
n/a Points
2014-08-09 6:12 pm

The two commands you listed in steps 12 and 13 do not work. It said directories not found in my terminal. What now?

20,728 Points
2014-08-11 12:44 pm
Hello Matt,

I did try those commands again and they work for me on my Mac Book Pro running OSX Mavericks. Can you tell me what version you're using and what you're seeing when you're trying to run the command?

Copy the command to make sure that you're using it correctly. If you're copying the code by looking at it, it's easy to mistake the "~" for a dash. Give us some idea of what's happening, and the actual commands you're using and we'd be happy to look into it for you.

Arnel C.

n/a Points
2014-08-11 2:02 pm


I typed it and copied it, but when I enter the command in shell it says no directory found. This was after the cd desktop command. It didn't ask to create it either. At this point I'm not sure it matters. Tech support said I needed PuttY or xShell. They did say that the server ports were 2222 not 22. But the reason for this was to update the version of Image Magick on the server to have compatibility with a piece of custom software. Unfortunately, they said I would need to upgrade to VPS or Dedicated. So I guess no need now. Thanks.

20,728 Points
2014-08-11 2:27 pm
Hello Matt K.,

Sorry for the confusion. Unfortunately, even with Putty/Xshell you would not be able to update a shared server's version of ImageMagick. That can only be done by the Systems team. This would require a support ticket request. However, since this is a server-wide update on a shared server, it would typically not be approved.

Also, FYI - support is correct in saying you need PuTTY or XShell - but only for PCs. The commands do work above. If you did not have the .SSH directory, you simply needed to create it. The terminal program provided with your Mac is an excellent terminal and no other terminal program is required to connect with SSH. I am working on a tutorial for this very issue to be released soon.

Arnel C.
n/a Points
2014-10-09 11:42 am

What is the -K option in 'ssh-add -K id_dsa'?  Haven't found documentation for that yet.

20,728 Points
2014-10-09 12:26 pm
Hello C. Munque,

Thanks for the question. Here's what the -K does ("-k" in lower case is different):

-K Enables GSSAPI-based authentication and forwarding (delegation) of GSSAPI credentials to the server.

-k Disables forwarding (delegation) of GSSAPI credentials to the server.

GSSAPI stands for Generic Security Services Application Program Interface.

Basically, it's used to validate the user you're using to login to SSL. I hope that helps to provide you some information on that command.

Arnel C.
n/a Points
2014-10-16 4:04 am

I did the steps to add ssh key to my key chain but i got the following error and can't find a solution: 

Ryans-Mac:~ Jarg$ ssh-add -K ~/downloads/id_dsa




Permissions 0640 for '/Users/Jarg/downloads/id_dsa' are too open.

It is required that your private key files are NOT accessible by others.

This private key will be ignored.

12,753 Points
2014-10-16 9:24 am
Hello Ryan,

Thank you for contacting us. I found some posts, where changing the permissions on the key file to 400 helped.

Also, see our guide on how to SSH to a Shared Server using OSX.

If you have any further questions, feel free to post them below.

Thank you,
n/a Points
2014-10-17 12:14 am

I got passed the chmod 400 part and added key to my keychain now when i try and run:

ssh -p 2222 I get permission denied error


n/a Points
2014-10-17 12:18 am

also, what server is the correct server address? There are several listed in the cpanel. The shared hosting one?

11,156 Points
2014-10-17 8:56 am
The server name will be listed in your cPanel to the left. On shared hosting, it will be something like
n/a Points
2014-10-23 5:20 pm

Awesome, thanks Arn for the step-by-step instructions and JeffMa for hinting where you can get the server name from (Note: you need to "expand stats" in CPanel in the area JeffMa indicates to get the server name).




n/a Points
2014-07-02 12:29 am

I got SSH working on my macbook pro! Heres how:

Follow arn's instructions above but on step #14, specify port 2222 and it will work.

ssh -p 2222



either will work.

Normally ssh defaults to port 22. Specify port 2222 and everything will work!


To get the ssh username and servername, login to your AMP:

and click on Account Technical Details.


n/a Points
2014-07-02 9:40 pm

Thanks Nick! It worked! I have another issue right now other than ssh. I realized that python virtualenv is not installed. I expected it was installed already. How can I demand it installed? Thanks in advance.

9,968 Points
2014-07-03 4:59 am
Hello ironstone,

You can install the Python virtualenv on either a VPS or dedicated server yourself with root access.

Or you can submit a ticket to see if it's one of our installable softwares available.

I don't believe their are any current plans of having Python virtualenv available on our shared or reseller servers. But you can check directly with our system administration team by submitting a ticket to find out.

- Jacob
n/a Points
2014-08-10 9:48 am

re. connecting via Mac: I've got my id_dsa copied to ~/.ssh, I've changd its permissions to 600 (because the system squaks otherwise) and I'm trying to connect using:


ssh <myUserNam> -p 2222

and I keep getting a Mac dialog box that states:

"Enter your password for the SSH key "ID_dsa"

But none of my passwords work! Not my local user pw, not my Inmotion pw, not the pw I created when generating the certificate. What he heck is this asking for?!


23,312 Points
2014-08-11 12:27 pm
Hello Chris,

That is not something that is specific to our servers. I was able to find a bit of information on the web regarding your particular error on an apple-related forum.

Kindest Regards,
Scott M
n/a Points
2014-08-29 7:51 pm

I figured out my problem - I'd make my key's password too complicated (lots of special characters and the like). Something about it wouldn't let the Mac accept it (even though I'd entered it correctly).Regenerating with a simpler key got me around the problem.

n/a Points
2014-08-16 10:45 am
step 3 in first part needs modification (generate new key)
12,753 Points
2014-09-30 12:37 pm
Hello Rami,

Thank you for the catch. I have updated Step 3 with the correct information.

If you see any other problems, feel free to let us know.

Thank you,
n/a Points
2014-09-30 11:41 am

I got this error message after running the command to add to my MacBookPro.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Permissions 0644 for 'id_dsa' are too open.It is recommended that your private key files are NOT accessible by others.This private key will be ignored.

12,753 Points
2014-09-30 12:55 pm
Hello James,

Thank you for contacting us. I found a post about the WARNING: UNPROTECTED PRIVATE KEY FILE error, in the Official Apple discussion forums, where they (Jeffrey Jones2)provide a possible solution:

"id_dsa should be your private key. If it is a folder, then your configuration is screwy. As you have seen, it is mandatory that this file be readable by the user only.

In Leopard, the passphrase can be put into your Keychain using the command "ssh-add -K.

If you have any further questions, feel free to post them below.

Thank you,
n/a Points
2014-09-30 1:06 pm

The file was downloaded and saved to the desk-top as instructed? I'll read up on your reference further.

n/a Points
2014-10-18 2:44 am

I am now having the problem when i ssh to my server saying ssh -p 2222

Permission denied (publickey).

12,753 Points
2014-10-20 12:09 pm
Hello Ryan,

Thank you for contacting us today. I spent some time searching online, and this error is typically caused by one of the following:

Incorrect Hostname, Incorrect key, or Incorrect Username.

I recommend checking these to ensure they are correct.

Thank you,
n/a Points
2014-10-18 2:55 am

now when i do step 5 

  1. Under Private SSH Key id_dsa conversion to ppk format: enter the password you saved in step 5 of the previous section. Then click the Convert button.

Im getting a blank key and error 400 when i try to download anything. Please help.

12,753 Points
2014-10-20 12:26 pm
Hello ryan,

Thank you for contacting us again. If this is still not working in cPanel, I recommend contacting Live Support.

This will allow them to to test your server, and replicate the error in your specific account.

Thank you,
n/a Points
2014-11-13 9:52 am

Hi ,

I followed the above tutorial for SSH , but i got the below error massage 

"" server refused our key

no supported authntication method available (server sent:publickey) ""


can you please help



12,753 Points
2014-11-13 12:28 pm
Hello davoud,

Thank you for your question. This error often occurs when there is no private key setup in putty, or the path is incorrect.

In the SSH using Putty section of the above article, ensure you have completed Step 2:
"Click Browse under Private key file for authentication, then select the private key you downloaded in the last section, and click Open."

This should setup the private key as a "supported" authentication method.

If you have any further questions, feel free to post them below.

Thank you,
n/a Points
2014-11-21 2:40 pm
dont know but steps are not working
11,156 Points
2014-12-16 10:47 am
Could you clarify what particular step you are having trouble with?
n/a Points
2015-02-20 9:46 pm

I am getting this error now: Are you sure you want to continue connecting (yes/no)? yesFailed to add the host to the list of known hosts (/Users/*****/.ssh/known_hosts).

Permission denied (publickey).

23,312 Points
2015-02-23 8:21 pm
Hello Romeo,

Have you tried re-creating the key? If so and are still getting the error, you may want to contact our Live Support team to see if they can help you with an account specific issue.

Kindest Regards,
Scott M

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

43 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!