2014-04-22 2 views
0

Bitbucket/git 계정을 만들었습니다. 웬일인지, 나는 물건을 엉망으로했고, repo를 밀어 올리는 데 실패했다. 서둘러 ~/.ssh 디렉토리를 삭제했습니다.내 ~/.ssh 디렉토리가 삭제되었습니다.

어떻게 수리하나요?

+0

최근 백업에서 복원 하시겠습니까? –

+0

나는 백업이 있고 나는 bitbucket 초보자이다 확실하지 않다. –

+0

그러면 새로운 RSA 키를 생성하고 내 대답과 링크를 볼 수 있습니다. Regerating key는 세계의 끝이 아니며 Heartbleed의 모든 부수적 인 손상으로 인해 지금은 세계에서 최악의 상황이 아닐 수도 있습니다 (heartbleed는 SSH에 특별히 영향을 미치지는 않지만 많은 손상을 허용했습니다 키/정보 누출). – codenheim

답변

0

.ssh 디렉토리의 내용에 따라 다릅니다. ,

1) id_rsa/id_dsa/id*.pub - These are your private and public keys; your identity; 
the key(s) that authenticate you to the remote SSH (git) server. If you lost the private 
key, and don't have a backup then you are out of luck and will have to create a brand 
new private/public keypair, and repeat the process you originally went through to 
authorize your ssh/git client. In short, run ssh-keygen to generate new keys (today I recommend 
you use 2048 bit length), and then proceed to Bitbucket to register your new public key 
with the server. 

2) If you also used authorized_keys, you will need to recreate that file or 
find a backup. Those are only _public_ keys from other hosts that you use to login to 
"this" host using key based authentication. If this is just a client machine, you likely 
wont have an authorized_keys file. 

3) known_hosts - The public server keys of SSH servers that you have accepted 
in past sessions. It will be auto-created next time you connect to a 
remote SSH server and accept a key forever. It is maintained by your SSH 
clients, so don't worry about that file. You will, however, receive warnings as if 
you've never connected to servers before until the file is fully repopulated. 

그래서 중요한 하나 (1) 귀하의 개인 키를 백업하지 않고 교체 할 수 없습니다 :

일반적으로, SSH를 디렉토리 파일 3 종류가 포함되어 있습니다.

비트 키퍼 : 링크가 지금까지 한마디로, 나쁜가는 경우 https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git

당신은 RSA 키 (구글 SSH-Keygen은)을 생성하기 위해 ssh를-Keygen은을 사용하여, 당신은 비트 키퍼 계정 설정에 갈 필요 id_rsa.pub (공개 키) 부분에 추가하십시오.

Github에서은 비슷하다 https://help.github.com/articles/generating-ssh-keys

마지막으로는, 항상 당신이 물리적으로 안전한 곳에 보관 엄지 드라이브에 개인 키 파일의 백업을합니다.

관련 문제