Kashif Wahaj's Blog

Setup SSH Locally in Shared Hosting Environment

By Kashif Wahaj on May 10, 2023
Image post 6

Easily Steps to Connect Shared Hosting Server Via SSH 🫡

Everything will be in this article will be according to me by default whether it is mentioned or not. Here is my try, to explain you the process in simpler way.

Step 1: Get Local SSH key

for Linux and Mac

Running following command will get you the SSH key

filename: terminal
 cat ~/.ssh/id_rsa.pub 

Note: if this give error ,then try run below command

filename: terminal
ssh-keygen
cat ~/.ssh/id_rsa.pub

for Windows

Running following command will get you the SSH key

filename: terminal
type C:Users\USERNAME\.ssh\id_rsa.pub

insert your username or windows pass to the key, Note: if this give error ,then try run below command

filename: terminal
ssh-keygen
type C:Users\USERNAME\.ssh\id_rsa.pub

After running command key will be print on command prompt/terminal, COPY this key

key will look like below:

filename: terminal
ssh-rsa AAfdsfEAAAADAQABAAACAQDDC9E5TrOBnBjsCVL4KwMkbbHXsF//mjvArN/  pXF0ciborNorqDB95kFSwBfbP1SEf/iFPjszO8lm4C5fVBhfdgfdgI5cIzRazS1cP4+EOIXGwFwv+efI5v+svU4vnm1416FU1eAc0yvqWzlxMnPejAdyCQIlP40cDhUyv84Z2Og1Aj6r2oleKNiDmE6L+jkauHx8zjSrJDknOaEilmmVxZ3s2RQyCW0515eHPfCQ95m53ccNCSLA+X3B4keNLiqP6IdW31vwp3XbGBNUR2OniU1VIQt9IJulmks5yFih28mH1oFjH7eNOvnf9ybNueoCvi7af5YDBQQwNKe/wP6maTgjq2/hBfRPD1Cp6X7zVzdfdsfP5HL4KWWnPpzFSc20peT8Bc8kEQPWbMW9K+rG0eEMgVz0a6phPAFd8SJ9nYWNS3BWUt0YMWzDeR2PeYbvGmi7ri1RIo1Hlwzbi+qFeMEA1KLIGolMekNpU7+tHqEIsu7kGk9to1SLOksphOY/qISw== “kashifwahaj@gmail.com”

Step 2: Import this key into your shared hosting panel

Look for SSH menu in your hosting panel and then got to import key , give any name and paste key in key textarea and then submit.

It will generate SSH connection crendentials for you to connect SSH locally.

Step 3: Now Connect SSH from Local Machine Terminal

Now after importing your SSH configuration will be available in hosting panel, now if you click details or credentials in SSH in hosting panel you will get 3 things

  1. SSH hostname
  2. SSH username
  3. SSH port

Now, Open Terminal or Command Prompt

filename: terminal 
ssh username@hostname -p port

Now if terminal ask you for further confirmation, then type yes and hit enter.

Done

Let me know in comment below if anything wrong, or needs to be updated in this article or email me at kashifwahaj@gmail.com

Recent Posts
Image post 6

What is Action Class ?

Dec 26, 2024
A SRP implemenation for better code
Image post 6

CRUD Multi Pattern

Dec 11, 2024
Pattern to better code quality, testability, and reusability
Image post 6

Client Server Architecture

Mar 11, 2024
Checklist for better code quality of React / Javascript Code.