Access Cpanel via SSH without password
Tags: tutorial, bash, git, productivity
Published: 2019-07-13 06:01:00

**Hi**, This is my very first post in this platform. I would like to show you guys today the way you can access your cpanel without password and by setting the ssh just once! and after then by using your development machine you'll be able to login to your cpanel and access the full system without any password or any other credentials. So let's just rock it. 

I had previously did this same thing 2-1 years back. But I forgot now. and didn't find any good article where the process mentions properly, That's why I was messing with it for few hours and finally figured and so thought to share with you. hopefully, you'll like this post.

The very first thing is we need to open up your git bash terminal or any other bash terminal you've then

####1. First we have to generate SSH key pair from your development machine

to do this follow this article [Generating a new SSH key](https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)
(Also don't forget to add that to ssh agent like it showed on that article)
When you're done with creating the ssh key pair we're almost 50% done. now follow the next

####2. Now let's import the created SSH key to cpanel

go to your cpanel and login into it. now find out the Security tab where you'll get a option like **SSH Access**
![SSH Access Option click on it](https://i.imgur.com/V9tz4hq.png)
Note: *When you're on a fresh cpanel, this might not be enabled. so contact your cpanel provider and ask them to enable so you can access to cpanel via SSH.*

Now get inside of that option and then you'll see something like that manage ssh keys click on it
![manage ssh keys button](https://i.imgur.com/LYOgfBW.png)

Now you have to import the key that you've generated earlier. to do that click on that button
![Import Key](https://i.imgur.com/61is1nP.png)

Now you'll get some fields that needs to be filled out with the information that you've generated to your development machine

here is how it will look like
![](https://i.imgur.com/m590I3n.png)

and that's it! you've added your local generated ssh key pair to the cpanel where you want to access the panel without any password or security credentials.

####Final Step is to authorize the added key pair
Now get back one step and then you'll be able to see the list of key pair you've  and also you'll see the one we imported right away. You'll see something like this
![](https://i.imgur.com/Bih82S6.png)
click on the **manage** button on the right side. and then it will take you to here
![](https://i.imgur.com/oME2zGR.png)

Now you've to click on the authorize button. and that's it. we're done!

**You have successfully added your local SSH key to server**

If you don't know yet how to login then now? 
That's super easy as well. You know the username and password of your hosting from there you'll have to use the username only and the domain name. that's it!
example: ``user_name@example.com``

now open up your local computer bash terminal in my case it's git
and type command like that below
![type in terminal](https://i.imgur.com/1oOSdEA.png)

If you have completed all the above step successfully then you are already entered to your cpanel without typing any password.
![](https://i.imgur.com/OYx4aP8.png)

###Now to keep that configuration saved so you can use it after restarting PC
you need to do one more thing for that and that is save the private key to `ssh` config file so that it detect every time you want to access this server and use that key against of the host.  so for that create or open the `config` file `~/.ssh/config` like so. and then you have to add identityFile like this way.
`
IdentityFile location_for_the_private_key
`
**Note**: *You can add as many identityFile you want to*
in my case it was `~/Downloads/soci***pector_io_rsa` this. If you do save this config then you're done.


**That's it for today** I work as a Full-Stack engineer for around 4 years. but didn't write any article to any platform this is my first post here. Pardon if any mistake happens

Thank you so much for reading this post. if you find this helpful then spread it.