I've been following this tutorial to install and setup git on Ubuntu Server 10.04 using Windows 7 as a client. However, after finally figuring out how it works (executed gitosis-init a bunch of times on the wrong key), I copied the id_rsa.pub
file over to the server in /tmp
folder and ran it again.
Unfortunately it still doesn't work and when I execute
git clone [email protected]:gitosis-admin.git
it asks for gitosis
's password rather than the RSA Passphrase. I'm assuming is the same problem this guy is having here... however, after following his instructions:
Purge git-core and gitosis and manually remove the /srv/gitosis folder
and following the instructions again (with the proper id_rsa.pub file this time), I'm still having the same issue.
Anyone know what I'm doing wrong? Is there any way to probe for more information that might help in solving this?
Edit: output from ssh -vvv gitosis@{IP_ADDRESS}
(The last few lines show where it's switching from publickey to password):
{UserName}@{COMPUTERNAME} ~
$ ssh -vvv gitosis@{IP_ADDRESS}
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug2: ssh_connect: needpriv 0
debug1: Connecting to {IP_ADDRESS} [{IP_ADDRESS}] port 22.
debug1: Connection established.
debug1: identity file /c/Users/{UserName}/.ssh/identity type -1
debug3: Not a RSA1 key file /c/Users/{UserName}/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
# Repeated 23 times here...
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /c/Users/{UserName}/.ssh/id_rsa type 1
debug1: identity file /c/Users/{UserName}/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3p1 Debian-3ubuntu6
debug1: match: OpenSSH_5.3p1 Debian-3ubuntu6 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
# Bunch of stuff here that doesn't seem important... I can include if necessary
debug3: check_host_in_hostfile: filename /c/Users/{UserName}/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host '192.168.0.113' is known and matches the RSA host key.
debug1: Found key in /c/Users/{UserName}/.ssh/known_hosts:1
debug2: bits set: 526/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /c/Users/{UserName}/.ssh/identity (0x0)
debug2: key: /c/Users/{UserName}/.ssh/id_rsa (0xa01a428)
debug2: key: /c/Users/{UserName}/.ssh/id_rsa (0x0)
debug1: Authenications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Trying private key: /c/Users/{UserName}/.ssh/identity
debug3: no such identity: /c/Users/{UserName}/.ssh/identity
debug1: Offering public key: /c/Users/{UserName}/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /c/Users/{UserName}/.ssh/id_dsa
debug3: no such identity: /c/Users/{UserName}/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password #it just switched to password...
debug3: remaining_preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
gitosis@{IP_ADDRESS}'s password:
As per this chat discussion, on possible cause was:
HOME
(correctly set to/C/Users/UserName
)ssh-copy-id
command, contrary to the msysgit bash shell)Since
ssh-copy-id
only copy a line to a file (See "ssh-copy-id and duplicates in authorized_keys", it was simpler to:/c/Users/UserName/.ssh/id_rsa
, snce$HOME
refers to/c/Users/UserName/
)~/.ssh/authorized_keys
of the server (since a direct access to said server was possible here).The OP user29600 fixed it!