ssh-config를 통해 git 저장소에 접근

ssh-config를 통해 git 저장소에 접근

cygwin에서 내 git 저장소로 푸시하려고 하는데 아무 소용이 없습니다. 예전에는 작동했습니다. 알겠어요

$ git push
ssh: Could not resolve hostname prooftheory: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

이제 내 ssh-config 파일을 읽을 수 있습니다.

-rwxrwxr--+ 1 user Tartományfelhasználók 230 Dec 10  2015 /cygdrive/c/Users/user/.ssh/config

그것은 포함한다

Host phd
    HostName bitbucket.org
    IdentityFile ~/.ssh/id_rsa
    IdentitiesOnly yes
    User git

Host prooftheory
    HostName bitbucket.org
    IdentityFile ~/.ssh/pt_rsa
    IdentitiesOnly yes
    User git

.git/config에는 다음 내용이 포함되어 있습니다.

[remote "origin"]    
        url = ssh://git@prooftheory/gergely_/prooftheory.git
        fetch = +refs/heads/*:refs/remotes/origin/*

bitbucket.org에 핑을 보낼 수 있습니다. . 내가 여기서 무엇을 놓치고 있는 걸까요?

편집하다

https://serverfault.com/questions/518729/cygwin-ssh-issue-could-not-resolve-hostname-awshost1-hostname-nor-servname-pro

cygwin은 다른 곳에서 ssh 구성 정보를 얻을 수 있다고 하지만 ~/.ssh/config를 사용하도록 git을 구성하는 방법은 명확하지 않습니다. 해당 구성을 ~/.ssh/ssh_config에 복사했지만 도움이 되지 않았습니다. 불행하게도 ssh -vvv는 읽는 구성 파일을 작성하지 않습니다.

답변1

먼저 심볼릭 링크를 만들어야 했습니다.

/home/user

도착하다

/cygdrive/c/Users/user

그리고 아래

https://serverfault.com/questions/253313/ssh-hostname-returns-bad-owner-or-permissions-on-ssh-config

어떤 것을 만들어

chmod 600 ~/.ssh/config

효과가 있었습니다.

나는 아직도 얻는다

key_load_public: invalid format

오류가 발생했지만 그럼에도 불구하고 지금은 작동합니다.

답변2

GIT_SSH이와 같이 git 변수를 사용할 수 있습니다 GIT_SSH="ssh -F ~/.ssh/config"(그리고 Windows 설정에 대한 경로를 조정합니다).

관련 정보