http://qs321.pair.com?node_id=11148968


in reply to Re: perl in the stars
in thread perl in the stars

I have a single ssh key that I use for authentication, connected to my email address. Github gets the public key (as does the git config on any other remote git server I interact with). After any reboot, the first command I run is ssh-add so that all terminals I open already have my credentials (nobody else has access to this computer), and interaction with github and others is seamless.

Ok, I thought I was getting the upper hand with this:

$ xclip -sel clip < id_rsa.pub

But then...

fritz@laptop:~/.ssh$ ssh -T tallharry66@gitlab.com The authenticity of host 'gitlab.com (2606:47...:a9b9)' can't be estab +lished. ECDSA key fingerprint is SHA256:....w. Are you sure you want to continue connecting (yes/no/[fingerprint])? y +es Warning: Permanently added 'gitlab.com,2606:4700:....' (ECDSA) to the +list of known hosts. tallharry66@gitlab.com: Permission denied (publickey). fritz@laptop:~/.ssh$

So I'm not there yet. Was the .pub one the right one to give to gitlab?

(I hope I haven't left my auth key bare here.)

is @gitlab.com right?

Fishing for tips,

Replies are listed 'Best First'.
Re^3: perl in the stars
by bliako (Monsignor) on Dec 19, 2022 at 15:40 UTC

    After copying the locally stored public key to clipboard (xclip ...) one needs to paste it to gitlab's dashboard's relevant textbox, I think.

      Indeed. It needs to go in here.


      🦛

        Thx, hippo, I had gotten that far. I was able to find syntax help at gitlab help forum.

        fritz@laptop:~/.ssh$ ssh -T git@gitlab.com Welcome to GitLab, @tallharry66! fritz@laptop:~/.ssh$

        But I still can't get over the hump. I try to imitate what I remember doing with github, but I'm not getting through the usual command sequence:

        cd existing_repo git remote add origin https://gitlab.com/perlmonks/betelgeuse.git git branch -M main git push -uf origin main

        I am making progress:

        fritz@laptop:~/Documents/gitlab1$ git init Initialized empty Git repository in /home/fritz/Documents/gitlab1/.git +/ fritz@laptop:~/Documents/gitlab1$ ll total 36 drwxrwxr-x 4 fritz fritz 4096 Dec 19 13:07 ./ drwxr-xr-x 10 fritz fritz 4096 Dec 17 16:47 ../ -rwxrwxr-x 1 fritz fritz 1122 Dec 17 00:34 1.betelgeuse.pl* -rwxrwxr-x 1 fritz fritz 1916 Dec 18 22:44 2.betelgeuse.pl* -rwxrwxr-x 1 fritz fritz 1890 Dec 18 22:38 2.betelgeuse.pl.bak* -rwxrwxr-x 1 fritz fritz 1783 Dec 18 23:57 3.betelgeuse.pl* -rwxrwxr-x 1 fritz fritz 1737 Dec 18 23:51 3.betelgeuse.pl.bak* drwxr-xr-x 2 fritz fritz 4096 Dec 15 21:44 conf_files/ drwxrwxr-x 7 fritz fritz 4096 Dec 19 13:07 .git/ fritz@laptop:~/Documents/gitlab1$ git remote add origin https://gitlab +.com/perlmonks/betelgeuse.git fritz@laptop:~/Documents/gitlab1$ git branch -M main error: refname refs/heads/master not found fatal: Branch rename failed fritz@laptop:~/Documents/gitlab1$ git push -uf origin main error: src refspec main does not match any error: failed to push some refs to 'https://gitlab.com/perlmonks/betel +geuse.git' fritz@laptop:~/Documents/gitlab1$

        What am I missing now?

        Other Git Resources

        gitlab docs

        git cheat sheet

        Cheers,

Re^3: perl in the stars
by soonix (Canon) on Dec 19, 2022 at 07:35 UTC
    I think we are not supposed to use ssh directly to login to gitlab/github/bitbucket/etc, only via git clone/push/pull/...
    You are supposed to create a repository via the web interface, and they show you the correct git incantation to connect your local repo with the remote.
    PLUS you might have to select "ssh" instead of "http(s)"...