[git-users] Re: Confusing git -T g...@github.com exit status

2014-10-22 Thread Igor Shpakov
I know it's been a while, but I have recently had similar problem and the 
solution I settled on looks like this:

ssh -q g...@github.com 2>&1 | grep "successfully"

this is a simple check to see if user authed or not. will return 0 if yes, 
1 in all other cases.

Hope that helps

On Tuesday, March 4, 2014 4:47:21 PM UTC, Andrew Pennebaker wrote:
>
> I want to git clone some private repos as part of a Vagrant installation. 
> I can do this with help from ssh agent forwarding, Puppet, and 
> puppet-vcsrepo. However, I have to write a Puppet exec step to accept 
> GitHub's server key:
>
> `git -Tv g...@github.com  -o StrictHostKeyChecking=no`
>
> A trace shows SSH authentication completing successfully, but this command 
> returns an exit status code of 1 (failure). This oddity confuses my Puppet 
> script, leading it to believe that the command failed, preventing the next 
> steps in my Puppet script from executing.
>
> Trace:
>
> $ vagrant provision
> ...
> Notice: /Stage[main]/Main/Exec[ssh know gitlab]/returns: executed 
> successfully
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: OpenSSH_5.9p1 
> Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: Reading 
> configuration data /etc/ssh/ssh_config
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: 
> /etc/ssh/ssh_config line 19: Applying options for *
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: 
> Connecting to github.com [192.30.252.129] port 22.
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: 
> Connection established.
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: identity 
> file /home/vagrant/.ssh/id_rsa type -1
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: identity 
> file /home/vagrant/.ssh/id_rsa-cert type -1
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: identity 
> file /home/vagrant/.ssh/id_dsa type -1
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: identity 
> file /home/vagrant/.ssh/id_dsa-cert type -1
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: identity 
> file /home/vagrant/.ssh/id_ecdsa type -1
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: identity 
> file /home/vagrant/.ssh/id_ecdsa-cert type -1
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: Remote 
> protocol version 2.0, remote software version OpenSSH_6.2p2 
> Ubuntu-6ubuntu0.1+github2
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: match: 
> OpenSSH_6.2p2 Ubuntu-6ubuntu0.1+github2 pat OpenSSH*
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: Enabling 
> compatibility mode for protocol 2.0
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: Local 
> version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: 
> SSH2_MSG_KEXINIT sent
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: 
> SSH2_MSG_KEXINIT received
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: kex: 
> server->client aes128-ctr hmac-md5 none
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: kex: 
> client->server aes128-ctr hmac-md5 none
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: sending 
> SSH2_MSG_KEX_ECDH_INIT
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: expecting 
> SSH2_MSG_KEX_ECDH_REPLY
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: Server 
> host key: RSA 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: Host '
> github.com' is known and matches the RSA host key.
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: Found key 
> in /home/vagrant/.ssh/known_hosts:3
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: 
> ssh_rsa_verify: signature correct
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: 
> SSH2_MSG_NEWKEYS sent
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: expecting 
> SSH2_MSG_NEWKEYS
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: 
> SSH2_MSG_NEWKEYS received
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: Roaming 
> not allowed by server
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: 
> SSH2_MSG_SERVICE_REQUEST sent
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: 
> SSH2_MSG_SERVICE_ACCEPT received
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: 
> Authentications that can continue: publickey
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: Next 
> authentication method: publickey
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: debug1: Offering 
> RSA public key: /Users/apennebaker/.ssh/id_rsa
> Notice: /Stage[main]/Main/Exec[ssh know github]/returns: 

[git-users] Re: Confusing git -T g...@github.com exit status

2014-03-04 Thread Thomas Ferris Nicolaisen


On Tuesday, March 4, 2014 5:47:21 PM UTC+1, Andrew Pennebaker wrote:
>
>
> I apologize if this isn't quite the right forum for this question. If 
> you'd like, I can repost this to elsewhere.
>

I think it's an interesting question. I've always accepted the keys 
manually. Would of course be nice if Puppet could do that automatically 
(although maybe there are some risks to consider automating this step).

Some workarounds I can think of:

* Use the Git protocol git:// or https instead SSH
* Have puppet manually edit the known_hosts file as require-step
* Run something like this http://askubuntu.com/a/360056 as a require-step

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.