How to connect to SSH with terminal - Brown Surfing

How to connect to SSH with terminal

Posted on: July 25th, 2022
By: Efrain Lemus

Here’s a great tutorial from Siteground. I’m not sure how many other hosts do it this way, but I was also in a cPanel, and it seemed like they did it this way as well.

https://www.siteground.com/kb/access-site-ssh-connection/

ssh user1@hostname.com -p18765

I had used the remote connection feature from terminal on a Mac, but doing it straight through the terminal seems just as easy. You simply type “ssh” enter the username followed by the hostname and that’s it. In Siteground’s case you use the specific port they give you.

For the key, save it on your computer, and change the permissions with:

chmod 600 /Users/youruser/private_key

Then you load the key with the following command:

ssh-add /path/to/your/private_key

Enter the password you entered when generating the key. You need to do this first before making the ssh connection. Once you load the key, when you ssh, you won’t be prompted for a password.

Here’s the article on how to troubleshoot the “Permission denied (publickey)” error when connection over SSH

https://www.siteground.com/kb/permission-denied-publickey-error-ssh/

Have any questions or comments? Write them below!


Leave a Reply

Your email address will not be published.