[쿠버네티스] 깃랫 접속 ssh키 등록
원격깃랩으로 ssh 인증으로 접속하기
1. ssh 키생성
ssh-keygen -t rsa
root@jenkins:~# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:CXv8AcMzQ5D0Xdvc/utCHTa08HHVyHVXdXVuAQfrlEU root@jenkins
The key's randomart image is:
+---[RSA 3072]----+
| .oo. .++E^|
| .+ . . =B=O|
| . O . .+* B|
| + B o O |
| . S . .o +|
| . . . . ..|
| . . .|
| . .|
| oo |
+----[SHA256]-----+
root@jenkins:~# ls -al
total 40
drwx------ 1 root root 4096 Jan 15 00:11 .
drwxr-xr-x 1 root root 4096 Jan 12 05:20 ..
-rw------- 1 root root 798 Jan 15 00:11 .bash_history
-rw-r--r-- 1 root root 571 Apr 10 2021 .bashrc
-rw-r--r-- 1 root root 152 Jan 12 06:41 .gitconfig
-rw-r--r-- 1 root root 261 Jan 15 00:10 .profile
drwx------ 2 root root 4096 Jan 15 00:15 .ssh
-rw------- 1 root root 4181 Jan 15 00:10 .viminfo
root@jenkins:~# cd .ssh
root@jenkins:~/.ssh# ls
id_rsa id_rsa.pub
/* 궈한변경 */
chmod 700 id_rsa*
root@jenkins:~/.ssh# ls -al
total 20
drwx------ 2 root root 4096 Jan 15 00:15 .
drwx------ 1 root root 4096 Jan 15 00:11 ..
-rw------- 1 root root 2602 Jan 15 00:15 id_rsa
-rw-r--r-- 1 root root 566 Jan 15 00:15 id_rsa.pub
root@jenkins:~/.ssh# vi id_rsa.pub
root@jenkins:~/.ssh# cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQComYO9vn4IxEsA4w6uKBCnrBml+F4MqLROj4xnm6P/FnTS4pUiZKgXaBN170jt1A4OEDdByeqqWXvdzexqk10J/fnGKwiMSh/JHGlvyHeAw9HJF/EBBJBkAZchvATaVl8o3gvH8oLOoAEeq03Xg1yqZ5j7DmvhHccAWbXcmMbQdAN9/vIM2Q3CsC9H2KyRauT8HmGrcdAdNHszxdJa0UeNnIUZQWuZgJ7r7HI69HXHqnNbtR+psUEqg+2cPosNj3YYlNOId77RWQ2juDfLIQLxWW01eIm6KeYlXIDAd6vFOfEBdFU1gJGdgYN3ur8NX9ZGzcRWKUzZ9esF0F57JsXhLLH80hJumdx5ji73QzEJiw5gUWCkwK3dN94E4O77a80RN9TZ5erx8Eawc+1Appd379SyTQN6WH0cYW5p2Afi+w2IfPC81wjxUn9ygiovllzYna1HoAHJX6JCWgfr1z9bJHFU9eMoQZKO3eAeUnptTqsN02FzhVZE+IHm2KnjMgk= root@jenkins
root@jenkins:~/.ssh#
2. 생성된 ssh 키를 깃랩에 등록