2017-04-11 10 views
1

나는 아주 재능이 있습니다. 아마존 리눅스 인스턴스에서 그것을 구성하려고 시도했습니다. 가능한 설치 후 ssh-keygen 명령을 사용하여 ssh 키 쌍을 만들었습니다. 가 생성되면 나는 명령 "ssh를 복사 - ID 로컬 호스트"를 실행하려고하지만가능한 아마존 리눅스 허가 거부 (공개 키)

/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed 
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys 
Permission denied (publickey). 

누군가가이 문제를 해결하기 위해 나를 인도 할 수 아래의 오류로 끝났다.

답변

1
ssh-copy-id localhost 

로컬 호스트의 ssh 서버에서 암호 인증을 사용하지 않으면 작동하지 않습니다. 당신이 (가 로컬 호스트이기 때문에) 그냥 로컬 공개 키를 복사, 암호 인증을 허용하지 않고 pubkey 인증을 설정해야하는 경우

는 :

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys 
chmod 700 ~/.ssh/ 
chmod 600 ~/.ssh/authorized_keys 
# make sure the SELinux labels are correct: 
type restorecon && restorecon -F .ssh .ssh/authorized_keys 
+0

헤이 Jakuje, 그것은했다. 해결 방법에 대해 감사합니다. – linuxkaran

+0

[tour] (http://stackoverflow.com/tour) 섹션을 검토하여 질문을 해결하는 방법을 수락하는 방법을 이해하십시오. – Jakuje