Bug 3180 - ssh-add -d cannot take key from stdin
Summary: ssh-add -d cannot take key from stdin
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh-add (show other bugs)
Version: 8.2p1
Hardware: Other Linux
: P5 enhancement
Assignee: Damien Miller
URL:
Keywords:
Depends on:
Blocks: V_8_4
  Show dependency treegraph
 
Reported: 2020-06-11 08:22 AEST by Kane
Modified: 2020-10-02 14:55 AEST (History)
2 users (show)

See Also:


Attachments
Implement support for "ssh-add -d -" (4.02 KB, patch)
2020-06-26 13:52 AEST, Damien Miller
dtucker: ok+
Details | Diff
regress tests (3.27 KB, patch)
2020-06-26 15:02 AEST, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kane 2020-06-11 08:22:55 AEST
The -d option to ssh-add does not accept '-' as an alias for stdin. 

$ cat id_ed25519_test | ssh-add -d -
Bad key file -: No such file or directory
Comment 1 Darren Tucker 2020-06-19 15:09:08 AEST
On most platforms you can do "cat id_ed25519_test | ssh-add -d /dev/stdin".
Comment 2 Damien Miller 2020-06-26 13:52:48 AEST
Created attachment 3416 [details]
Implement support for "ssh-add -d -"

This adds support for "ssh-add -d -". It allows multiple keys to appear on stdin, one per line. This allows handy recipes like deleting all but certificates "ssh-add -L | grep -v 'cert-v01@openssh.com' | ssh-add -d -"
Comment 3 Damien Miller 2020-06-26 15:02:06 AEST
Created attachment 3418 [details]
regress tests

regress tests for previous
Comment 4 Damien Miller 2020-06-26 15:13:09 AEST
This has been committed and will be in the openssh-8.4 release, due in a few months
Comment 5 Darren Tucker 2020-10-02 14:55:00 AEST
Mass close of all bugs fixed in 8.4 release.