You are not logged in.

#1 2020-10-04 14:48:21

DoXer
Member
Registered: 2017-08-27
Posts: 36

[SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

Hi,
i want to submit the pub-key to an other system but get errors:

LC_ALL=C ssh-copy-id -i /home/michael/.ssh/id_rsa.pub michael@arch2020
/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/michael/.ssh/id_rsa.pub"
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
/bin/ssh-copy-id: line 251: warning: here-document at line 251 delimited by end-of-file (wanted `EOF')
/bin/ssh-copy-id: line 250: warning: here-document at line 250 delimited by end-of-file (wanted `EOF')
/bin/ssh-copy-id: line 254: /dev/null`: Permission denied
/bin/ssh-copy-id: line 260: EOF: command not found

Login with Password is possible. Using the command from an other machine runs fine.
How can I fix it?

Last edited by DoXer (2020-10-04 17:55:24)


--
Regards
Michael

Offline

#2 2020-10-04 15:32:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

Please post the output of the following:

pacman -Qo /bin/ssh-copy-id
pacman -Qkk openssh
sed -n '250,260p' /bin/ssh-copy-id

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2020-10-04 16:26:58

DoXer
Member
Registered: 2017-08-27
Posts: 36

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

pacman -Qo /bin/ssh-copy-id
/usr/bin/ssh-copy-id is owned by openssh 8.4p1-1

pacman -Qkk openssh
backup file: openssh: /etc/ssh/sshd_config (Modification time mismatch)
backup file: openssh: /etc/ssh/sshd_config (Size mismatch)
openssh: 59 total files, 0 altered files

sed -n '250,260p' /bin/ssh-copy-id
  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}; } &&
          cat >> ${AUTH_KEY_FILE} ||
          exit 1;
        if type restorecon >/dev/null 2>&1; then
          restorecon -F .ssh ${AUTH_KEY_FILE};
        fi
EOF

--
Regards
Michael

Offline

#4 2020-10-04 16:38:16

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

You are using the [testing] repo?

That script code is completely different from the current - and seems quite broken.

Last edited by Trilby (2020-10-04 16:39:57)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2020-10-04 16:45:27

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,383
Website

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

Mod note: Moving to testing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#6 2020-10-04 16:46:39

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

FYI, I've never bothered with that script anyways.  Just use scp to copy your key, then appended it to the authorized_keys file on the server.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2020-10-04 17:54:33

DoXer
Member
Registered: 2017-08-27
Posts: 36

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

Thx all

Two sessions learned
1. My new system (currently building) will not have testing repo
2. I use scp instead of ssh-copy-id


--
Regards
Michael

Offline

#8 2020-10-11 05:45:54

Mr. Svenson
Member
Registered: 2020-10-11
Posts: 1

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

Hey,

this fix has work for me very well.

https://github.com/openssh/openssh-port … d8c696R250

Offline

#9 2020-10-11 06:04:54

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

DoXer wrote:

Thx all

Two sessions learned
1. My new system (currently building) will not have testing repo
2. I use scp instead of ssh-copy-id

Side note, you can have them enabled, but only for specific usages, unless you specify

[testing]
Include = /etc/pacman.d/mirrorlist
Usage   = Sync Search

[community-testing]
Include = /etc/pacman.d/mirrorlist
Usage   = Sync Search

[multilib-testing]
Include = /etc/pacman.d/mirrorlist
Usage   = Sync Search

This appeared in Arch Planet at Dec 31 of 2019
Blog post: https://shibumi.dev/posts/my-pacman.conf-file

That way you can query and/or test install, avoiding everything bumping to testing versions

It IS also documented in `man pacman.conf`...

Last edited by GaKu999 (2020-10-11 06:10:40)


My reposSome snippets

Heisenberg might have been here.

Offline

#10 2020-10-13 01:23:20

thagoat
Member
Registered: 2020-10-13
Posts: 1

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

This is the winner!

Mr. Svenson wrote:

Hey,

this fix has work for me very well.

https://github.com/openssh/openssh-port … d8c696R250

Offline

#11 2020-10-13 02:27:40

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,229
Website

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

Welcome to the forums thagoat; please avoid power posting: https://wiki.archlinux.org/index.php/Co … mpty_posts

Offline

#12 2020-10-14 11:40:52

Lenry
Member
From: Szeged, Hungary
Registered: 2010-03-27
Posts: 64
Website

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

Mr. Svenson wrote:

Hey,

this fix has work for me very well.

https://github.com/openssh/openssh-port … d8c696R250

Hi

Sorry, but how do I use this?

Offline

#13 2020-10-14 12:31:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

Lenry wrote:

Sorry, but how do I use this?

The "right way" might be to retrieve the source code with abs, making the change, then rebuilding the package.

The smart way would just be to modify the installed file as it's just moving one closing parenthesis in a shell script.

The lazy way would be to wait for it to be included from upstream in an upcoming version of the package.  Though I am a bit concerned about this - from my perspective this seems like a glaring and ridiculously obvious error which is not to be expected from the development team behing this package.  This makes me wonder if I am missing something about how this code may work on a BSD system but not linux ... though I highly doubt this as the flawed-syntax used should not be valid in any POSIX shell.

Another lazy way would be - as noted above - just don't use this script.  I've always found the script a bit silly and mostly pointless.  It doesn't do much that you couldn't do pretty easily without it.  It's 300+ lines of (now flawed) shell script to do the same thing that one fairly simple ssh command can do (or one very very simple scp, plus one very very simple cat command on the server).

Last edited by Trilby (2020-10-14 12:33:57)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#14 2020-10-14 20:43:15

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

Trilby wrote:

The lazy way would be to wait for it to be included from upstream in an upcoming version of the package.  Though I am a bit concerned about this - from my perspective this seems like a glaring and ridiculously obvious error which is not to be expected from the development team behing this package.  This makes me wonder if I am missing something about how this code may work on a BSD system but not linux ... though I highly doubt this as the flawed-syntax used should not be valid in any POSIX shell.

Another lazy way would be - as noted above - just don't use this script.  I've always found the script a bit silly and mostly pointless.  It doesn't do much that you couldn't do pretty easily without it.  It's 300+ lines of (now flawed) shell script to do the same thing that one fairly simple ssh command can do (or one very very simple scp, plus one very very simple cat command on the server).

Maybe none of the openssh devs ever used the script! Since it's so silly and all.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#15 2020-10-14 21:04:03

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

Good point.  I suppose it doesn't make much sense to praise their quality control in one breath and ridicule a product of their labor in another.  But I am genuinely curious about the responsible developers point(s) of view on it as writing a complex script they don't use doesn't seem likely, nor - based on history and repution - does writing a fundamentally flawed / broken script.  This is why I suspect I may be missing something.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#16 2020-10-14 21:24:09

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

Apparently since February it comes from the ports collection (it's not clear to me where, if anywhere, it used to be), error introduced here:

http://git.hands.com/?p=ssh-copy-id.git … e2720657be

And peeking around in the openssh-portable distribution's history... https://github.com/openssh/openssh-port … 7ace3b64a3

"Updated to Phil Hands' greatly revised version"

So this is where they're syncing it from. It's not even from the openssh team, or developed by BSD affiliates. It's a contrib script specific to the portable edition, which openbsd itself relegates to a *port*.

Last edited by eschwartz (2020-10-14 21:24:33)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#17 2020-10-21 16:39:21

curtisleebolin
Member
Registered: 2014-09-07
Posts: 15

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

Mr. Svenson wrote:

Hey,

this fix has work for me very well.

https://github.com/openssh/openssh-port … d8c696R250


Thank you, Mr. Svenson.  You made my morning a little less frustrating.

Offline

#18 2020-10-21 19:03:51

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED] ssh-copy-id runs into error "/dev/null`: Permission denied"

Closing this solved topic.

Offline

Board footer

Powered by FluxBB