Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change SSH host for cloning

Tags:

gitlab

Is there any way to change default ssh host for gitlab (displayed at top of repository view in web interface)? I mean only for SSH in clone urls.

For example I have my gitlab installation on git.example.com, but example.com also points to the same machine (different site). Can I change ssh clone urls from:

git clone [email protected]:user/repository

to:

git clone [email protected]:user/repositiory

but for http and https leave it with git.example.com?

like image 360
GwynBleidD Avatar asked Mar 17 '14 15:03

GwynBleidD


People also ask

How do I create a new host key SSH?

To generate an SSH key on your Linux server run the command ssh-keygen . The command can take flags if you would like to customize the type of key that is generated as well as the signing algorithms used to generate the key. This example generates a standard 2048-bit RSA key without a passphrase.

How do I use SSH Hostkey?

Use the Show SSH Host Keys button on the same panel to verify that the host address and fingerprint are shown in the SSH host key list. Or, the SSH host key can be imported in the Partner Profile panel. Enter the partner information and verify the connection using the Test button.


1 Answers

Yes,

If you are using the omnibus package you can edit /etc/gitlab/gitlab.rb and add gitlab_rails['gitlab_ssh_host'] = 'example.host.com'

There is the equivalent option somewhere in gitlab.yml : ssh_host: example.host.com

like image 147
Alda Marteau-Hardi Avatar answered Sep 23 '22 00:09

Alda Marteau-Hardi