2

I am getting this error:

Permissions 0660 for '/dev/fd/63' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored.

when I run this:

ssh-add <(echo '<private key content>')

is there a way to change the permissions on the "file"?

ctrl-alt-delor
  • 27,473
  • 9
  • 58
  • 102
  • am I? I guess ssh-add can read from stdin? –  Jun 03 '20 at 01:03
  • no, that doesn't work @GillesQuenot, instead it just adds the default key at ~/.ssh/id_rsa –  Jun 03 '20 at 01:04
  • What's the use case? As in, why *not* write it to file? – l0b0 Jun 03 '20 at 01:23
  • I just felt like doing it that way so I didn't have to write it to a file –  Jun 03 '20 at 03:21
  • What would be the results on your system of these two commands? `ls -l <(echo test)` and `ls -lL <(echo test)` ? – A.B Jun 03 '20 at 10:14

1 Answers1

1

The error message is pretty clear, and man ssh-add states:

 Identity files should not be readable by anyone but the user.  Note that
 ssh-add ignores identity files if they are accessible by others.

For some reason your file descriptor has 660, but needs 600 permissions. This is not the case for me, but I did yet not find a way to change that (maybe some udev rule).

You may use a pipe instead:

printf '%s' '<private key content>' | ssh-add -

Similar question:

pLumo
  • 22,231
  • 2
  • 41
  • 66