4

I recently got a new computer and I'm trying to use ssh-copy-id to put my keys on another server so I can login without password. but when I try

ssh-copy-id -i ~/.ssh/id_rsa.pub user@server

and after inputting the correct password it returns

Ambiguous output redirect.

There are no other messages after that. I thought it was maybe just Ubuntu 12.10 so I installed Linux Mint 14 and sure enough exact same thing happens.

I've tried removing authorized_keys from the remote server but that didn't change anything.

Marc
  • 143

1 Answers1

3

This is what worked for me, thanks to Zoredache.

Be sure to replace $REMOTE_HOST with the host. NOTE: This assumes certain directories.

cat ~/.ssh/id_rsa.pub | ssh $REMOTE_HOST 'umask 077; mkdir -p ~/.ssh; cat >> ~/.ssh/authorized_keys'
Jonathan
  • 322