SourceTree와 gitlab을 사용할 일이생겨 SSH키를 사용해 연동하는도중 에러해결과정을 기록하기 위해 작성하였습니다.
AccessToken 발급
git clone 시 아래와 같이 'Authentication failed for ~'와 같은 오류가 발생하였습니다.
그 이유는 gitlab은 아이디, 비밀번호로 인증하는 방식이 아닌 Token을 사용하여 인증하는 방식이기 때문입니다.
gitlab의 AccessToken을 발급핟아 해결하였습니다.
[gitlab clone시 인증에러] (https://okky.kr/questions/1393108)
Sourcetree SSH 인증문제
sourcetree에 들어갈때마다 SSH키를 인증해야하는 번거로움이 발생하였습니다.
ssh-agent를 활용하여 해결할때 발생한 문제들입니다.
putty와 linux의 인증방식 차이
저는 putty를 사용하여 SSH를 발급받았습니다.
그럼 .ppk키가 발급되는데 이것은 putty전용 SSH키입니다.
따라서 linux가 인식할 수 있게 OpenSSH로 변경해야 합니다.
Putty에서 OpenSSH로 저장하는 기능을 제공하여 해결하였습니다.
[Linux SSH 사용시 error in libcrypto 해결하기](https://it-svr.com/linux-ssh-ppk-error-in-libcrypto/)
ssh-agent를 성공적으로 등록하여도 SourceTree에 들어갈때마다 SSH키 비밀번호를 요구하였습니다.
SourceTree의 터미널에서 SSH키 추가하기
SourceTree 내부의 터미널에서 ssh-agent를 사용해 보았습니다.
하지만 SourceTree에서 agent를 읽지 못하였습니다.
$ ssh-add -l
Could not open a connection to your authentication agent.
이것은 ssh-agent를 한번도 실행한 적이 없어 발생한 문제였습니다.
$ eval $(ssh-agent)
Agent pid 2546
위 명령어를 사용하면 ssh-agent와 관련된 명령어가 정상 작동하게 됩니다.
이후 ssh-add명령어를 사용해 ssh를 등록하니 지속적으로 비밀번호를 입력해야하는 문제가 해결되었습니다!
[ssh key 등록 시 Could not open a connection to your authentication agent. 오류 해결 방법](https://somjang.tistory.com/entry/GitHub-ssh-key-%EB%93%B1%EB%A1%9D-%EC%8B%9C-Could-not-open-a-connection-to-your-authentication-agent-%EC%98%A4%EB%A5%98-%ED%95%B4%EA%B2%B0-%EB%B0%A9%EB%B2%95)