Use git in ssh hostgator hosting using a public/private key

Asked

Viewed 223 times

0

I’m trying to access my hosting through the public and private key system but it’s giving error when I create the config file to access it without password

I created the key in gitbash through the "ssh-keygen" command and copied/pasted in the Cpanel area to import a public key and authorized it; I created the config file with in this structure:

Host rafael

Hostname -ip of my hosting-

Port 2222

User-user q use to access the Cpanel-

but when I try to access through "ssh rafael" error "ssh: Could not resolve hostname rafael: Name or service not known". Remembering to log in with user and password that I enter in Cpanel but because of the workflow I want to do this way. Does anyone have any light on what I might be missing?

  • You should use the command ssh rafael@ip -p2222, something like that. User@server

  • I put this syntax, it asks for a password and I set the key without password... and gives the same error :/

1 answer

-2

Browser other questions tagged

You are not signed in. Login or sign up in order to post.