카테고리 없음

[Git - Server] 깃 서버 SSH-KEY 생성

심심한 낙지 2019. 7. 30. 00:53

POOPOO: 배변 일기 앱

SMALL

목록


1) 깃 전용 유저의 루트디렉토리로 이동

# su gituser

$ cd ~

 

2) SSH-KEY 생성

$ mkdir .ssh

$ cd ./.ssh

$ ssh-keygen -t rsa

Enter file in which to save the key (/root/.ssh/id_rsa) : /home/gituser/.ssh/id_rsa 입력

Enter passphrase (empty for no passphrase) : 엔터키 입력

Enter same passphrase again : 엔터키 입력

$ vi authorized_keys (:wq 로 저장하여 파일 생성)

 

3) ssh key 관련 파일 및 폴더에 권한부여

$ chmod 700 ~/.ssh

$ chmod 600 ~/.ssh/id_rsa

$ chmod 644 ~/.ssh/id_rsa.pub

$ chmod 600 ~/.ssh/authorized_keys

LIST