Bug 1885336

Summary: ssh-copy-id throws a warning on F33 KDE base installation
Product: [Fedora] Fedora Reporter: David McCheyne <davidmccheyne>
Component: opensshAssignee: Jakub Jelen <jjelen>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 33CC: crypto-team, dwalsh, jjelen, lkundrak, mattias.ellert, ngompa13, plautrba, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-06 07:25:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David McCheyne 2020-10-05 16:10:01 UTC
Description of problem:
running ssh-copy-id as a non-admin user returns an error, but seems to complete anyway

Version-Release number of selected component (if applicable):
Fedora 33 KDE

How reproducible:
Consistently

Steps to Reproduce:
1. Install Fedora 33 KDE, standard options
2. create an ssh key with ssh-keygen and accept defaults
3. run `ssh-copy-id -f user@host`

Actual results:
ssh-copy-id throws a warning:
$ ssh-copy-id -f <user>@<host>
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/dmccheyne/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: line 251: warning: here-document at line 251 delimited by end-of-file (wanted `EOF')
/usr/bin/ssh-copy-id: line 250: warning: here-document at line 250 delimited by end-of-file (wanted `EOF')
/usr/bin/ssh-copy-id: line 254: /dev/null`: Permission denied
/usr/bin/ssh-copy-id: line 260: EOF: command not found

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '<user@host>'"
and check to make sure that only the key(s) you wanted were added.


Expected results:
ssh-copy-id completes cleanly with output like:
Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '<user@host>'"
and check to make sure that only the key(s) you wanted were added.

Additional info:
I've tried a few length keys, and copying keys into the host works ok. I suspect there's just a formatting issue with this block:
  INSTALLKEYS_SH=$(tr '\t\n' ' ' <<-EOF)
        cd;
        umask 077;
        mkdir -p $(dirname "${AUTH_KEY_FILE}") &&
          { [ -z \`tail -1c ${AUTH_KEY_FILE} 2>/dev/null\` ] || echo >> ${AUTH_KEY_FILE} || exit 1; } &&
          cat >> ${AUTH_KEY_FILE} ||
          exit 1;
        if type restorecon >/dev/null 2>&1; then
          restorecon -F .ssh ${AUTH_KEY_FILE};
        fi
EOF

Comment 1 Jakub Jelen 2020-10-06 07:25:38 UTC

*** This bug has been marked as a duplicate of bug 1884231 ***