progrium / gitreceive

Easily accept and handle arbitrary git pushes
1.14k stars 108 forks source link

sudo: no tty present and no askpass program specified #7

Closed azhang closed 11 years ago

azhang commented 11 years ago

I get sudo: no tty present and no askpass program specified when I try to cat ~/.ssh/id_rsa.pub | ssh [user]@[domainname] "sudo gitreceive upload-key myname"

progrium commented 11 years ago

I think that's because you aren't provide a user to ssh, so it would normally prompt you for one, but because it's not an interactive terminal, it can't. So you have to provide your programs with enough information or with the right options so they don't need to ask for input like that.

azhang commented 11 years ago

sorry, it was hidden because I accidentally used < and >. The issue is that it wants to ask for sudo password, but can't. I just wanted to point this out because this command is in the main readme.

progrium commented 11 years ago

Oh I see! Yes, that's problematic.

ghost commented 11 years ago

Hmm; I can't think of a good way to fix this - I don't encounter this as I'm using passwordless sudo. Perhaps we could document around it or encourage use of a user with access to ~git/.ssh/authorized_keys?

progrium commented 11 years ago

Maybe the init command can ensure authorized_keys gives global write permissions?

ghost commented 11 years ago

In the context of dokku any user on the system is able to manipulate containers using docker so I can't see a downside right now to adding global write to ~git/.ssh/authorized_keys.

We would also have to update documentation across the repositories by removing the sudo or ssh root@ recommendation for the upload-key sub-command.

azhang commented 11 years ago

ah, thanks for the quick responses everyone!