Home >Development Tools >git >A brief analysis of where the SSH public key is saved on the GitLab server
GitLab is a very popular code hosting platform. It uses the SSH protocol for code transfer and access. When we use the SSH protocol to access the GitLab server, we need to add our own SSH public key to the server. So, where is the SSH public key of the GitLab server stored? This article will answer it for you.
Where is the SSH public key of the GitLab server stored?
The SSH public key of the GitLab server is stored in the ssh_host_rsa_key.pub
file in the /etc/ssh
directory.
To view the SSH public key of the GitLab server, you can connect to the GitLab server via SSH and execute the following command:
$ cat /etc/ssh/ssh_host_rsa_key.pub
This command will display the SSH public key of the GitLab server.
Also, you can find the SSH public key of the GitLab server by following these steps:
sudo su - gitlab
cat /etc/ssh/ssh_host_rsa_key.pub
~/.ssh/id_rsa.pub file. After adding this public key to the GitLab server, you can access the GitLab server using the SSH protocol.
/etc/ssh/ssh_host_rsa_key.pub file. To ensure security, it is recommended that you generate an SSH key pair before adding the SSH public key.
The above is the detailed content of A brief analysis of where the SSH public key is saved on the GitLab server. For more information, please follow other related articles on the PHP Chinese website!