Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

gitlab set ssh key

Generate SSH Key:
- ssh-keygen -t rsa -C "Comment for key"

Add it to gitlab:
- cat ~/.ssh/id_rsa.pub (copy all output)
- Open web browser, go to: Gitlab > User Settings > SSH Keys
- Paste copied output in the SSH key section

Test connection:
- ssh -T git@gilab.domain.com (can use private url)

Do some git stuff:
- git clone something
Comment

Adding ssh key to gitlab

#For example, for ED25519:
> ssh-keygen -t ed25519 -C "<comment>"
#For 2048-bit RSA:
> ssh-keygen -t rsa -b 2048 -C "<comment>"

Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/user/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

> eval $(ssh-agent -s)
> ssh-add <directory to private SSH key>

Ssh config
# GitLab.com
Host gitlab.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/gitlab_com_rsa

# Private GitLab instance
Host gitlab.company.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/example_com_rsa
Comment

PREVIOUS NEXT
Code Example
Shell :: mac anydesk start at login 
Shell :: chmod directory and subdirectories 
Shell :: flutter create new project 
Shell :: how to untar a tar file 
Shell :: pip install ignore errors 
Shell :: how to stop docker service windows 
Shell :: keyboard abnt2 arch linux 
Shell :: zsh create alias 
Shell :: change package name flutter 
Shell :: android studio licenses 
Shell :: changing mac address linux 
Shell :: find large files in ubuntu 
Shell :: open android studio project from terminal 
Shell :: how to install .deb file ubuntu 
Shell :: cron logs 
Shell :: centos 7 install ifconfig 
Shell :: list of unmerged branches 
Shell :: gitk install 
Shell :: add ssh key to ssh agent 
Shell :: git revert all local changes 
Shell :: how to search forward in emacs 
Shell :: linux volume max or muted 
Shell :: bash list environment variables 
Shell :: unzip all to dir linux 
Shell :: nx run storybook 
Shell :: docker container could not open port /dev/ttyUSB0 
Shell :: linkedin video downloader terminal 
Shell :: run elasticsearch stop 
Shell :: how to see all branches in git 
Shell :: bash mysql query count get only number 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =