Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ssh through port 443 on gitlab not working

Tags:

gitlab

I am trying to use port 443 to push and pull my gitlab repository since my port 22 has been blocked (reference: https://about.gitlab.com/2016/02/18/gitlab-dot-com-now-supports-an-alternate-git-plus-ssh-port/)

I have given below my config file that i created (i created a new ssh key that I updated in my gitlab profile - Note: I did not add the server key as a deploy key, rather, I just added it in my profile)

my config file:

Host gitlab.com
        Hostname altssh.gitlab.com
        User gitlabusername
        Port 443
        PreferredAuthentications publickey
        IdentityFile ~/.ssh/id_rsa.pub

I keep getting the following error:

permission denied (publickey) fatal: Could not read from remote repository

Could the error be because of something other than the ssh key?

Regards, Galeej

like image 420
galeej Avatar asked Feb 18 '26 06:02

galeej


1 Answers

I just configured it and it's working well for me.

In your config file you need to use the private key id_rsa for authenticating not the public one id_rsa.pub

Host gitlab.com
  Hostname altssh.gitlab.com
  User git
  Port 443
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa

You may test the connection using using this command ssh -T -p 443 [email protected].

Make sure that you already added the public key id_rsa.pub to your GitLab account as described here.

like image 133
rifaidev Avatar answered Feb 21 '26 15:02

rifaidev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!