SSH: Testing whether ID is already in authorized_keys

Stephen R Laniel steve at laniels.org
Sun Sep 4 01:37:41 UTC 2005


On Sat, Sep 03, 2005 at 07:08:46PM -0400, Michael R Head wrote:
> You could do something like this:
> 
> ssh-copy-id -i ~/.ssh/id_dsa.pub user at host.com
> ssh user at hostname  "cat .ssh/authorized_keys |sort |uniq > .ssh/authorized_keys.uniq; mv .ssh/authorized_keys.uniq .ssh/authorized_keys"

Yeah, I thought of that just after posting. It still seems
like a bit of a hack, doesn't it? But maybe it's less of a
hack than any of the other possibilities.

-- 
Stephen R. Laniel
steve at laniels.org
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050903/ff5058b7/attachment.sig>


More information about the ubuntu-users mailing list