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

tengo at tutanota.de tengo at tutanota.de
Sun Mar 28 18:53:12 UTC 2021


Thanks for the explanation, it's very helpful.

 I run "bash -x /usr/bin/ssh-copy-id pi at 192... -o LogLevel=DEBUG" and although it provided a lot of output it doesn't  seem to highlight any issues (to my untrained eye). It seems to show the script running through checking if any keys are already there, prompting me for the user's password, then hanging. Very frustrating.

Although there's a lot more before this output here's a sample from the end of the output:
```
pi at 192.168.0.14's password:  
debug1: Authentication succeeded (password). 
Authenticated to 192.168.0.14 ([192.168.0.14]:22). 
debug1: channel 0: new [client-session] 
debug1: Requesting no-more-sessions at openssh.com 
debug1: Entering interactive session. 
debug1: pledge: network 
debug1: client_input_global_request: rtype hostkeys-00 at openssh.com want_reply 0 
debug1: Sending environment. 
debug1: Sending env LANG = en_GB.UTF-8 
debug1: Sending command: exec sh -c 'cd ; umask 077 ; mkdir -p .ssh && { [ -z `tail -1c .ssh/authorized_keys 2>/dev/null` ] || echo >> .ssh/authorized_
keys ; } && cat >> .ssh/authorized_keys || exit 1 ; if type restorecon >/dev/null 2>&1 ; then restorecon -F .ssh .ssh/authorized_keys ; fi'
```It just hangs at this point.
-----------

28 Mar 2021, 14:01 by justin.byam.rye at gmail.com:

> tengo at tutanota.de wrote:
>
>> @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.
>>
>
> It would send extra debug output to stderr, not stdout, and you might
> need to step it up to LogLevel=DEBUG or higher (DEBUG2, DEBUG3).
>
>> With regard to copying andediting the script I'm not following
>> that part, sorry.
>>
>
> You're running a bash script - an executable text file.  Instead of
> just running "ssh-copy-id" (i.e. /usr/bin/ssh-copy-id), you could copy
> that file to somewhere else, edit that version, and invoke the amended
> version.  Come to that, to make bash provide its own commentary on
> what it's doing (so you can see exactly what it's trying to do when it
> hangs), you don't need to edit it when you can invoke it as
>
>  bash -x /usr/bin/ssh-copy-id
>
> -- 
> Justin B Rye
> http://jbr.me.uk/
>
> -- 
> 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/1244c1f9/attachment-0001.html>


More information about the EdLUG mailing list