https 방식과 ssh 방식이 이해가 안되서 
고생하는 학생이 있어서...

https는 ID/PASSWORD 방식으로 구글에 로긴하는 방식과 같다.
ssh는 본인 컴에서 키 만들고 나온 pub 키(텍스트)를 아이디 묻는 사이트에 미리 등록해두는 방식.

https 방식은 세션 인증 방식이라서 ID/PASSWD를 입력해 주면 된다. 그러나 알다 시피 implementation을 잘못해서(정확히 말하면 개발자들이 git만 디버깅을 많이 해서) repository 싱킹할 때  버그가 많고 bitbucket/github의 경우 상당히 자주 꼬인다. 그래서 결국 git 명령어를 배우게 되는데

git clone git@github.com:ID/*.git_file

git pull
git add -A
git commit //comment at the top of vim and :wq  or use -m " " option
git push

 

가 우리가 자주 쓰는 명령어.


ssh-keygen 은 키를 생성시켜주는 명령어
$ ssh-keygen -t rsa -b 2048 -C "myKey"

 

고 이 키는

 

~/.ssh 폴더 내에 있어야 한다. 맥이나 리눅스는 바로 먹고 윈도우도 git bash가 있으니

어차피 같은 bash shell 이다.



ssh 기본 키를 만들면(MAC이던, LINUX던 Windows던)

public key가 텍스트 형태로 있는데 그 녀석만 github 에 deploy 해줘야 한다.

SourceTree에서는 putty/Plink 방식이 아닌 OpenSSH로 설정하는게 마음이 편하다.

 ppk키가 아닌 새롭게 생성한 키로(ssh -i 옵션과 같다) 계정 설정을 해 두면 ID/PASS 방식에서
나던 소소한 에러들이 해결된다.

다음과 같은 에러가 날 때는


sourceTree terminal을 열고


ssh-keygen


vim ~/.ssh/id_rsa.pub 을 열어 

빗벗켓 계정 setting 에 ssh keys 메뉴에 추가해 줘야 한다.

여러개의 키를 사용할 때는

 

~/.ssh/config 를 손봐야 한다.

config 파일은 소스트리에서 자동 생성 해주는데 https://git-scm.com/ 꺼랑 호환이 안되는 것 같다.

수동으로 고쳐줘야 한다.

Host github.com
HostName github.com

으로 해줘야 한다.  소스트리는 HostName 에 탭이 들어가는데 탭 없애서 모두 같은 라인에 있도록 해주어야 한다. Host의 경우도 내가 새로 생성한 키 이름으로 되어 있는데 github.com 으로 해줘야 해당 키를 제대로 찾더라.(그 전에는 키를 못 찾겠다는 오류없이 기본키로 자동 설정되어서 오류 내용을 알기가 애매했었음)

IdentityFile 과 User  까지 설정해주면 끝.(인터넷에 자료가 많으니 더 이상 자세한 설명은 생략한다)
중요한 것은 config에 4개 필드만 있으면 된다는 것.


- 다음 -

Key is invalid. It must begin with 'ssh-ed25519', 'ssh-rsa', 'ssh-dss', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', or 'ecdsa-sha2-nistp521'. Check that you're copying the public half of the key




git@bitbucket.org: Permission denied (publickey).


fatal: Could not read from remote repository.






Please make sure you have the correct access rights


and the repository exists.


git@bitbucket.org: Permission denied (publickey).


fatal: Could not read from remote repository.






Please make sure you have the correct access rights


and the repository exists.


git@bitbucket.org: Permission denied (publickey).


fatal: Could not read from remote repository.






Please make sure you have the correct access rights


and the repository exists.


git@bitbucket.org: Permission denied (publickey).


fatal: Could not read from remote repository.






Please make sure you have the correct access rights


and the repository exists.


git@bitbucket.org: Permission denied (publickey).


fatal: Could not read from remote repository.






Please make sure you have the correct access rights


and the repository exists.


git@bitbucket.org: Permission denied (publickey).


fatal: Could not read from remote repository.






Please make sure you have the correct access rights


and the repository exists.


git@bitbucket.org: Permission denied (publickey).


fatal: Could not read from remote repository.






Please make sure you have the correct access rights


and the repository exists.


git@bitbucket.org: Permission denied (publickey).


fatal: Could not read from remote repository.






Please make sure you have the correct access rights


and the repository exists.


git@bitbucket.org: Permission denied (publickey).


fatal: Could not read from remote repository.






Please make sure you have the correct access rights


and the repository exists.


git@bitbucket.org: Permission denied (publickey).


fatal: Could not read from remote repository.






Please make sure you have the correct access rights


and the repository exists.


git@bitbucket.org: Permission denied (publickey).


fatal: Could not read from remote repository.






Please make sure you have the correct access rights


and the repository exists.


git@bitbucket.org: Permission denied (publickey).


fatal: Could not read from remote repository.






Please make sure you have the correct access rights




and the repository exists.



후임 2명과 일하는 메신저는 슬랙으로 바꿨다. 얼마전 이야기 했지만 ㅡㅡ;

채널, 트렐로, 깃헙 연동은 당연한 거지만.

카톡은 기본적으로 2대씩 쓰는 컴퓨터에 계속해서 로긴/로그아웃을 해야 하는데

슬랙은 이미 로긴이 다 되어 있으니 너무 편하다.

넘흐 조아 ^^

SLACK is the best business tool for us.

회사 잘되면 메신저는 슬랙으로 통일하자고 해야지.

'Blog History' 카테고리의 다른 글

437  (0) 2020.06.07
436  (0) 2020.06.07
434  (0) 2020.06.07
433  (0) 2020.06.07
432  (0) 2020.06.07

+ Recent posts