1

I have a CentOS 7.4 vServer with Plesk Onyx 17.5.3. I have a domain example.com and the subdomains gitlab.example.com and jenkins.example.com. On the subdomains I have installed and configured gitlab and jenkins. All webspaces have the same system user "shop". I have created a gitlab user "jenkins". I want to use this gitlab user in jenkins to use the gitlab projects in my deployment. With the username and password credentials it is working fine. But now I want to use a SSH key for that. On my vServer I have to generate a SSH Key now for the user "shop", true? And then I have to add that key to the gitlab user "jenkins" and in jenkins I can add new Credentials with the name "jenkins" and the new SSH Key. Is that correct?

I have tried to use ssh-keygen for the "shop" user. I logged in to that account via ssh and then I used 'ssh-keygen'. Now I'm getting 'bash: ssh-keygen: command not found'. Then I tried it with the root user and that was working. But thats not the correct user where I have to generate the SSH Key, true? How can I generate the Key now for the 'shop' user?

Nono
  • 1,073
  • 4
  • 23
  • 46

1 Answers1

0

With the username and password credentials it is working fine

That means you need to add a public ssh key to the GitLab user account corresponding to that username/password.

The ssh private and public keys can be generated anywhere ssh-keygen is available.

cd any/path/you/want
mkdir tmp
ssh-keygen ssh-keygen -t rsa -C "key for my Git repo server" -q -P "" -f tmp/id_rsa

You will need to copy the tmp/id_rsa and tmp/ida_rsa.pub to the user running the process trying to access your GitLab repo. If that process is run by "shop", then you need to copy those keys to ~shop/.ssh, and mind the permissions (see "Creating SSH keys for Gerrit and Hudson" as an example).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250