ssh-copy-id: Issue with target machine with non-sh shell

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



Hi!

I have the following issue with ssh-copy-id:

The login-shell of the user I am trying to copy my keys to is fish. fish does not
behave very sh-y. For example it does not support `command || alternative`, which
makes it choke on the following part of the script (lines 273 ff):

    ssh "$@" "
      umask 077 ;
      mkdir -p .ssh && cat >> .ssh/authorized_keys || exit 1 ;
      if type restorecon >/dev/null 2>&1 ; then restorecon -F .ssh .ssh/authorized_keys ; fi?

There is a very simple solution to this, which would make the code more robust in 
general: execute the code on the target machine in a `/bin/sh -c '<code>?` call,
like this:

    ssh "$@? ?/bin/sh -c '
      umask 077 ;
      mkdir -p .ssh && cat >> .ssh/authorized_keys || exit 1 ;
      if type restorecon >/dev/null 2>&1 ; then restorecon -F .ssh .ssh/authorized_keys ; fi??

Please consider adding this to ssh-copy-id :)

Best regards,
Lukas Stabe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20131224/dae16ff2/attachment-0001.bin>


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux