furier / websync

websync is intended to be an rsync manager, where rsync tasks can be added, scheduled and maintained in a sane manner.
http://furier.github.io/websync/
MIT License
484 stars 91 forks source link

ssh-copy-id not working for websync@docker container #6

Closed furier closed 6 years ago

furier commented 10 years ago

To investigate the problem I logged on to the websync docker container with nsenter, and tried to use the ssh-copy-id command and got the following feedback:

/usr/bin/ssh-copy-id: ERROR: No identities found

Since I rememberd I had generated a ssh key previously, I went looking for it in ~, which resulted in:

-bash: cd: /home/<username>: No such file or directory

hmmm, it sais i'm logged in as root... /root/.ssh/id_rsa exists but it didn't try to use that id...

Then I tried specifying the key file with the ssh-copy-id command and got another result:

mktemp: failed to create file via template '/home/<username>/.ssh/ssh-copy-id_id.XXXXXXXXXX': No such file or directory
mktemp failed

creating the directories /home/<username>/.ssh/ solved the problem, but this is still a problem that needs to be fixed generally.

gpapin commented 9 years ago

I have the same issue,

When I try to setup a new host then click on 'SSH' button I'm being asked for a password (I was using private key authentication so I wasn't sure what I needed to put in the password field so I had to create a password for my user ... ) Then When I hit 'connect' I have this error /usr/bin/ssh-copy-id: ERROR: No identities found I'm not sure what this means, and how to solve it ...

Any ideas ?

furier commented 9 years ago

@0x1gene it means exactly what is sais, it can not locate any ssh rsa identities for the current user. Two reasons come to mind why this would happen.

like if your ssh identities are located under /root/.ssh/ but you are logged in as oxigene it would look for your ssh identities under /home/oxigene/.ssh/

Also, are you experiencing this with the Docker container or regular?

behinddesign commented 8 years ago

sshpass -p 'mypass' ssh-copy-id -o StrictHostKeyChecking=no user@host

https://github.com/furier/websync/blob/master/lib/ssh-copy-id.js#L42

This was the only way I was able to get websync working in a docker environment. By default, sshpass wasn't able to send the password through to ssh-copy-id when it prompts for a fingerprint.

This obviously has it's downsides but without building a UI to confirm the fingerprint, it needs to be skipped.