Post

Generate SSH keys for Websupport GitLab

How to generate SSH keys and configure ~/.ssh/config for pushing to a Websupport-hosted GitLab repository.

First, generate a new SSH key pair and then add the remote repository using the SSH URL. After that, you can commit and push files to the Websupport GitLab instance over SSH.

1
2
3
4
5
6
7
ssh-keygen -t rsa -b 4096 -f ~/.ssh/websupport-ssh -C "toth.janci@gmail.com"

git remote add sshorigin git@gitlab.websupport.sk:linuxinuse/arch-dotfiles.git
git add -f <some-file>
git commit -m "Adding some file: <some-file>"
git push sshorigin master

Next, set up the ~/.ssh/config file so that SSH automatically uses the correct key when connecting to gitlab.websupport.sk.

1
2
3
4
5
6
7
8
9
10
11
vim ~/.ssh/config

...
# linuxinuse account
Host gitlab.websupport.sk
        HostName gitlab.websupport.sk
        User git
        IdentitiesOnly yes
        IdentityFile ~/.ssh/websupport-ssh
...
:wq!
This post is licensed under CC BY 4.0 by the author.