[EdLUG] SSH - ssh-copy-id problem | RPi | Ubuntu.

tengo at tutanota.de tengo at tutanota.de
Sun Mar 28 12:37:54 UTC 2021


Thank you Andrew and Justin for replying. I appreciate your response.Please find my response below.


@Justin - sorry, butI'm not following your suggestions due to my lack of knowledge.Could you simplify it further for me, please? Are you saying that by"-o LogLevel=VERBOSE" should see more output in stdout when running ssh-copy-id?If so, I don't see anymore than before. With regard to copying andediting the script I'm not following that part, sorry.


@Andrew - pleasefind a response to your questions and suggestions below.


"Usernames:Are you specifying the user at server in the command, or just letting ituse your current user (the default)?"

 Response: I'm ssh'ing using auser on the pi named 'pi', example "ssh pi at 192...", andusing the same with ssh-copy-id, example "ssh-copy-idpi at 192....". I've used this method on both laptops.

"Are youusing it with -i to actively specify the public key to transfer, orare you letting ssh guess?"

Response: I generally don't use '-i' as I only haveone key on the system. Also, I've not had to use '-i' before andI don't fully understand its use (I understand the purpose).

"If so,check what identities it's finding using ssh-add -L."

 Response:Running 'ssh-add -L' on the laptop or Pi(via ssh) produces thefollowing
>$sudo ssh-add -L
>Couldnot open a connection to your authentication agent.

"As to why it hangs,I don't know. I'm sure you've already come across this and ruled outX11 forwarding in your ssh config."

 Response: I had seen that post,but it didn't quite seem like it was the same. However, I can confirmthat the setting is commented out to the default of 'no'('#ForwardX11no') in "/etc/ssh/ssh_config" on both laptop and Pi (I don't have a~/.ssh/config on either)

I'll give more thought as to why this occurring.

-----------



28 Mar 2021, 12:17 by andrew at kember.net:

> That is perplexing. 
>
> I don't know the cause of your problem, but the next steps I'd try for debugging are:
> Given it works from a different laptop (same OS), identify what could be different:
> Usernames: Are you specifying the user at server in the command, or just letting it use your current user (the default)?
> Are you using it with -i to actively specify the public key to transfer, or are you letting ssh guess?
> If so, check what identities it's finding using ssh-add -L
> As to why it hangs, I don't know. I'm sure you've already come across > this <https://stackoverflow.com/questions/38179980/ssh-copy-id-hanging-sometimes>>  and ruled out X11 forwarding in your ssh config.
> Let us know what you come up with!
>
> Kind regards,
> Andrew. 
>
> On Sun, 28 Mar 2021 at 11:39, <> tengo at tutanota.de> > wrote:
>
>> Good morning,
>>
>> I'm having a problem with the "ssh-copy-id" script and would appreciate some guidance on troubleshooting.
>>
>> I have a Raspberry 3B+ running the latest Raspbian/RaspberryOS. I like to SSH to the Pi without using a password and I'm therefore using SSH keys.
>>
>> The problem...
>>
>> I can SSH to the Pi with a password, but when I use ssh-copy-id to copy my SSH key it simply hangs. No crash, no error, just hangs. I can see the SSH connection/authentication is successful from following the journal on the Pi. It seems the copy doesn't complete.
>>
>> If I manually add my SSH key to the Pi I can connect without using a password.
>>
>> Any suggestions as to why this is happening?  ssh-copy-id doesn't seem to have an option to provide a verbose output that would allow me to see where it's hanging.
>>
>> I tried the ssh-copy-id from another laptop, running Ubuntu 20.04, and it worked fine. As did running a simple ansible ad-hoc command. Even the SSH extension for VS code worked. This led me to try installing a fresh OS on the original laptop. The laptop I was trying to connect from was running Ubuntu 20.04. I've since installed Kubuntu 20.04 (I wanted to try KDE anyway) and still the same issue is occurring.
>>
>> Any suggestions welcome.
>>
>> Regards,
>>
>> John
>> -----------
>> --
>>  EdLUG mailing list
>>  >> EdLUG at mailman.lug.org.uk
>>  >> https://lists.edlug.org.uk/mailman/listinfo/edlug
>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.edlug.org.uk/pipermail/edlug/attachments/20210328/26634953/attachment.html>


More information about the EdLUG mailing list