InMotion Hosting Support Center

The Secure SHell (SSH) command line is available through an Apple Macintosh computer using their Terminal program. A private and public key pair is required before you can connect to the server. These instructions are are intended for use with a shared server. Learn more about SSH Hosting.

Generate Key for Shell Access

  1. SSH/Shell Access

    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. Manage SSH

    Click on the button labeled Manage SSH Keys

  3. Generate/Manage a new key

    Click on the button labeled Generate a new key

  4. Type in a password (do NOT use the password generator), then confirm it. Make sure to write down the password you used. Leave the key type at DSA and key size at 1024.
  5. If you are creating a key for the first time, 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/Download for the PRIVATE key. This is the key that you will need to load onto your Mac.
  8. Download the file to your Mac client. To make it simple for this tutorial, copy the file to your desktop.
  9. Key not authorized

    Before we move to the Mac side of things, you should check to see if 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.

The next portion of the process requires that you login to your Mac as an administrator. We will be using the default Terminal program in order to login to SSH using the key that we generated above.

Use Apple Terminal Program to Connect to SSH

  1. 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. Note that if you are not logged into your Mac as the administrator you will not be able to make these changes.
  2. Go to your desktop where you copied the ID_DSA file. The terminal command is: cd desktop
  3. Make sure that the ID_DSA 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.

  4. 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.

  5. You should see a confirmation that the identity has been added to your Mac. When this is complete, you will 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:


    ssh -p 2222 cpanelusername5@servername.inmotionhosting.com


    Here's an example: ssh -p 2222 user5@ecbiz188.inmotionhosting.com)

  6. If this is the first time you have connected the server, you may see a message stating that it can't identity the 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.

This completes the tutorial for creating a new SSH key to connect your Mac terminal program to the InMotion Hosting shared server SSH. For best security practices, make sure to keep your key private and don't share the password unless necessary.

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Social Media Login

   
Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2017-11-17 1:16 am

 

Hi,

I got following message. Any one can help me please

 

ssh_exchange_identification: read: Connection reset by peer

 

Thanks

Rdb

Staff
40,336 Points
2017-11-17 11:36 am
Hello Rdb,

The error you're seeing may depend on how you're connecting (or what you're using to connect) to SSH. Check out this forum post and see if matches the issue you're having. If you are unable to resolve it then please contact our live technical support team (if you're an InMotion Hosting customer), as they have the necessary access to review the issue directly and resolve it.
n/a Points
2017-08-02 4:56 am

how to connect ssh -p2222 cpanelname@servername.com guide me on this what to typ correct credentials as im using godaddy. im at terminal everything added guide me this command according to my servername

Staff
13,821 Points
2017-08-02 8:11 am
I'd suggest reaching out to GoDaddy for specifics to connect to their servers.
n/a Points
2016-11-09 7:48 am

Simplest on Mac would be 

1. Download your key2. Open Finder Press Cmd+Shift+G and type ~/.ssh/3. Drag & Drop id_rsa file from Downloads to ~/.ssh/ folder4.  Open Terminal type chmod ~/.ssh/id_rsa 5.  Add key ssh-add -K ~/.ssh/id_rsa 6. Connect using ssh -p 2222 username@domainname.com

n/a Points
2016-10-08 12:37 am

Your instructions say "Leave the key type at DSA and key size at 1024" but it defaults to RSA/2048. I'm assuming the default is the option we should go with now; if so, you might want to update your docs to say the same thing.

Staff
43,761 Points
2016-10-10 9:14 am
Yes, you can use 2048. We will make the edit to the article to reflect that.
n/a Points
2016-10-04 5:06 pm

I'm on linux (Mint), so the support agent directed me here.

After successfully `ssh-add`-ing the new id_rsa key, I'm still getting the same "Permission denied (publickey)"

...tried, both,  `ssh {my-user-name}@biz205.inmotionhosting.com -p 2222`  and  `ssh {my-user-name}@23.235.208.135 -p 2222`.

Same failure either way (as expected).

Staff
10,043 Points
2016-10-04 6:13 pm
For Linux, this is fairly more simple than on Mac (which is what the above article is about). You just need to generate a key in your local computer with ssh-keygen -t rsa and copy the public key into the "authorized_keys" file in .ssh folder on your server.
n/a Points
2016-10-03 5:16 pm

many thanks folks for your quick feedback.

actually, I'm aware about that and i did follow to the letter your instructions with sensitvite K as I checked in man ssh that is the right command but I'm still getting the same error. Checking internet I could'nt find anything. What does it mean the error message? is it a bad file or wrong command option?

 

I'm in ssh folder and I'm running the following file:

 

 

ssh -add -K ~/.ssh/id_rsa.1475429822

after copying the id_rsa.1475429822 into the folder as it was described in your post.

 

 

Staff
10,043 Points
2016-10-04 7:56 am
If the command posted here is the command being used then it appears there is still a space after ssh. I suggest trying to copy and paste the command from the article above to see if that gets the desired result.
n/a Points
2016-10-02 4:50 pm

Hello Team,

 

many thanks for the tutorial. Actually, when I run the  ssh -add -k ~/.ssh/id_dsa

I get the following error message:

 

ssh: illegal option -- d

usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]

           [-D [bind_address:]port] [-e escape_char] [-F configfile]

           [-I pkcs11] [-i identity_file]

           [-L [bind_address:]port:host:hostport]

           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]

           [-R [bind_address:]port:host:hostport] [-S ctl_path]

           [-W host:port] [-w local_tun[:remote_tun]]

 

           [user@]hostname [command]

 

i'm stuck and I spent hours looking for a solution. Could you please help?

 

Staff
10,043 Points
2016-10-03 8:55 am
Trying using the command this way: `ssh-add -K id_dsa`. Remember these commands are case-sensitive.
n/a Points
2016-06-23 3:44 am

Hi,

I'm stucked at step 4 where identity is supposed to be added in my computer. When I put command ssh-add -K id_dsa

It asked me for password and I enterd one that i used while creating key in cpannel but it is replying me

Bad passphrase, try again for id_xxx

I have tried many times and I created the key again with password but the problem is still there!

Staff
30,388 Points
2016-06-23 12:09 pm
In our tests, the above guide works. If your problems persist, you may have to contact live support so they can test within your specific account.

Thank you,
John-Paul
n/a Points
2016-03-20 7:45 pm

Type sudo before the code for people with 0644 error!

n/a Points
2015-11-29 9:10 pm

After step 3 I was getting the same open permission problem as everyone else. I set the permission to 600 then cd into the SSH folder and it resolved the problem. 

n/a Points
2015-08-19 12:32 am

I got the same error message, I resolve it with chmod 600 id_rsa and all works fine)

n/a Points
2015-11-03 10:56 am

I've tried all the suggestions here. And still getting that error.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Permissions 0644 for 'id_dsa' are too open.

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

This private key will be ignored.

 

 

 
Staff
10,077 Points
2015-11-03 12:20 pm
Hello Sherissa,

According to the error you provided the private key is still set to 644 instead of 600. Please try changing the file permissions again to 600.

Best Regards,
TJ Edens
n/a Points
2017-07-17 10:11 am

Oly use your comand with "sudo" like this "sudo ssh -add -K ~/.ssh/id_rsa". It resolve that message.

n/a Points
2015-07-03 12:16 pm

Hi, Thanks for the tutorial. I have setup the ssh like this tutorial. But when I am going to connect it's showing this message "ssh: connect to host [myServerIp Here] port 2222: Connection refused". Any idea?

Staff
43,761 Points
2015-07-06 3:34 pm
Hello Ali,

Some of our older servers do not allow SSH connections. If you definitely need it, you can contact our Live Support and they can move you to one of the servers that have that ability.

Kindest Regards,
Scott M
n/a Points
2015-05-15 2:12 pm

My cpanel says it is authorized, but when I try to log in via terminal, it says I'm not.Anything I can do to fix this?

Staff
40,336 Points
2015-05-18 12:14 pm
Hello Mike,

Sorry for the problems with getting into SSH. I know that you've posted your question in the SSH instructions for Mac, but what version of OSX are you using? Did you go through the steps listed above? Can you please provide account information so that we can check it? We would need more information in order to troubleshoot the issue. Please give us a little more info and we would be happy to help.

If you have any further questions or comments, please let us know.

Regards,
Arnel C.
n/a Points
2015-04-11 10:37 pm

That worked fine for me under Linux too. Thanks!

n/a Points
2015-02-03 5:38 am

Hello,Thanks for this tutorial. However, I am getting the following error:

Identity added: /Users/admin/.ssh/id_dsa (/Users/admin/.ssh/id_dsa)

 

Permission denied (publickey).

I'm running on OSX Yosemite 10.10.2Thanks in advance!

Staff
11,186 Points
2015-02-03 10:01 am
Be sure that you have the correct user and server defined when connecting. If you are certain that you do, you may need to follow the steps again to re-generate a new key and add it.
n/a Points
2014-12-03 2:38 am

I did every think like said but when I put the command ssh-add -K id_dsa

I get this message

Permissions 0644 for 'id_dsa' are too open.

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

 

This private key will be ignored.

 

How to resolve this error?

Staff
30,388 Points
2014-12-03 11:11 am
Hello GASPAS,

Thank you for contacting us. The "permissions are too open" error is usually caused by the permissions level of the private key you are using.

Instead of 644, they should be set to 500. Here is a link to our guide on How to change file permissions and ownership settings while in SSH

Thank you,
John-Paul

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

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

30 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

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: support@InMotionHosting.com
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!