| Summary: | ssh-copy-id fails with message 'Ambiguous output redirect.' with a non-sh style remote shell | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Petr Lautrbach <plautrba> | ||||
| Component: | ssh-copy-id | Assignee: | Philip Hands <phil> | ||||
| Status: | CLOSED FIXED | ||||||
| Severity: | normal | CC: | abc.mikey, jjelen, mu, phil, radek | ||||
| Priority: | P5 | ||||||
| Version: | 6.5p1 | ||||||
| Hardware: | Other | ||||||
| OS: | Linux | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 2451 | ||||||
| Attachments: |
|
||||||
|
Description
Petr Lautrbach
2014-02-27 02:48:49 AEDT
I use the Fish shell which does not use the &&. So this causes errors here as well: ssh-copy-id mu@martin-pi.local /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys mu@martin-pi.local's password: fish: Expected a command name, got token of type 'Job im Hintergrund ausführen'. Did you mean 'COMMAND; and COMMAND'? See the help section for the 'and' builtin command by typing 'help and'. Standard input: mkdir -p .ssh && cat >> .ssh/authorized_keys || exit 1 ; ^ The suggestion by Petr Lautrbach sounds good, since you cannot rely on the shell, you have to start your own. Maybe some script could be shipped with the openssh-server that accepts the keys? Hello, I am experiencing the same problem with the fish shell. The reported solution seems like it should really be implemented. Relying on the shell of the server seems unreliable at best. same issue here (with fish shell on remote). what can i do to get this fixed? Created attachment 2756 [details]
use "sh" on remote system
Actually we had to use one-line version of this patch, because some other shells (tcsh) do not support multi-line arguments well. The readability is not better, but we achieved more portability. We carry in Fedora this patch: http://pkgs.fedoraproject.org/cgit/openssh.git/tree/openssh-6.8p1-fix-ssh-copy-id-on-non-sh-shell.patch Upstream doesn't seem to be interested in fixing this so at least for the others who will encounter such problems and who would like to fix. Thanks for the patch, and sorry for not getting to it sooner. My latest version, incorporating something very similar is available here: http://git.hands.com/ssh-copy-id which I'd hope works for you (confirmation would be nice), and will hopefully make it's way into OpenSSH in the not too distant future. Cheers, Phil. Close all resolved bugs after 7.3p1 release |