UFO ET IT

ssh-copy-id ID 없음 오류

ufoet 2020. 12. 7. 21:17
반응형

ssh-copy-id ID 없음 오류


인증 프롬프트없이 ssh 키를 누르고 서버에서 로그인해야하는 클라이언트 시스템이 거의 없습니다.

먼저 서버에서 아래와 같이 성공적으로 ssh 키를 생성했습니다.

]# ssh-keygen -t rsa -N "" -f my.key

둘째, pub 키 복사를 시도했지만 ID 오류없이 실패합니다. 여기서 잘못된 단계를 밟고 있습니까?

]# ssh-copy-id my.key.pub 10.10.1.1
/usr/bin/ssh-copy-id: ERROR: No identities found

다음 -i플래그 를 사용해야합니다 .

ssh-copy-id -i my.key.pub 10.10.1.1

로부터 man 페이지 :

-i 옵션이 제공되면 ssh-agent에 키가 있는지 여부에 관계없이 ID 파일 (기본값 : ~ / .ssh / id_rsa.pub)이 사용됩니다. 그렇지 않으면 다음과 같은 경우 : ssh-add -L이 출력을 제공하면 ID 파일보다 우선적으로 사용합니다.


다음 명령 실행

# ssh-add

다음 오류가 표시되는 경우 : 인증 에이전트에 대한 연결을 열 수 없습니다.

이 오류를 제거하려면 다음 명령을 실행하십시오.

# eval `ssh-agent`

클라이언트에서 ssh 키를 생성하면 해결되었습니다.

$ ssh-keygen -t rsa

ssh-copy-id가 시스템에서 ssh-keygen에 의해 생성 된 id_rsa.pub 파일을 찾을 수 없습니다. 다음 명령을 사용하여 완료하십시오.

  1. .pub 파일의 경로를 찾으십시오. locate *.pub
  2. 경로 (예 : /home/user_name/.ssh/id_rsa.pub)를 복사하고 다음 명령을 실행합니다. ssh-copy-id -i /home/user_name/.ssh/id_rsa.pub hostname

-i 옵션을 사용하여 키를 지정해야합니다.

ssh-copy-id -i your_public_key user@host

감사.


가장 간단한 방법은 다음과 같습니다.

ssh-keygen
[enter]
[enter]
[enter]

cd ~/.ssh
ssh-copy-id -i id_rsa.pub USERNAME@SERVERTARGET

Att :

매우 간단합니다.

"ss-keygen"의 설명서에서 설명합니다.

"설명 ssh-keygen은 ssh (1)에 대한 인증 키를 생성, 관리 및 변환합니다. ssh-keygen은 SSH 프로토콜 버전 1에서 사용할 RSA 키와 SSH 프로토콜 버전 2에서 사용할 DSA, ECDSA 또는 RSA 키를 생성 할 수 있습니다. 생성 할 키는 -t 옵션으로 지정됩니다. 인수없이 호출하면 ssh-keygen은 SSH 프로토콜 2 연결에 사용할 RSA 키를 생성합니다. "


이전 게시물이지만 오늘이 문제가 발생하여 인터넷 검색이 끝나고 여기에 있습니다. 나는 그것을 스스로 알아 냈지만 동일한 문제가있을 수있는 다른 사람을 돕기 위해 내 문제와 해결책을 공유 할 것이라고 생각했습니다.

발행물:

[root@centos [username]]# ssh-keygen -t rsa

Enter file in which to save the key (/root/.ssh/id_rsa):난 그냥 쳤어요

/usr/bin/ssh-copy-id: ERROR: No identities found

해결책:

Enter file in which to save the key (/root/.ssh/id_rsa): **/home/[username]/id_rsa**

루트로이 작업을 수행하는 경우 로그인하려는 사용자 디렉토리에 키를 복사하고 있는지 확인하십시오. 루트 사용자 디렉토리가 아닙니다.

I was sshing into the machine when performing this operation, so I guess ssh-copy-id just point to the dir you are logged in as by default.

Hope this helps anyone.


Actually issues in one of Ubuntu machine is ssh-keygen command was not run properly. I tried running again and navigated into /home/user1/.ssh and able to see id_rsa and id_rsa.pub keys. then tried command ssh-copy-id and it was working fine.


came up across this one, on an existing account with private key I copied manually from elsewhere. so the error is because the public key is missing

so simply generate one from private

 ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub

I had faced this problem today while setting up ssh between name node and data node in fully distributed mode between two VMs in CentOS.

The problem was faced because I ran the below command from data node instead of name node ssh-copy-id -i /home/hduser/.ssh/id_ras.pub hduser@HadoopBox2

Since the public key file did not exist in data node it threw the error.


In my case it was the missing .pub extension of a key. I pasted it from clipboard and saved as mykey. The following command returned described error:

ssh-copy-id -i mykey localhost

After renaming it with mv mykey mykey.pub, works correctly.

ssh-copy-id -i mykey.pub localhost

참고URL : https://stackoverflow.com/questions/22530886/ssh-copy-id-no-identities-found-error

반응형