{"thread":{"id":"25753","subject":"Setting up Git Server over SSH","startedAt":"2010-11-15T18:20:15Z","lastAt":"2010-11-17T02:25:43Z","messageCount":5,"participants":["Dennis","Shawn Pearce","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"155932","messageId":"B99C7057496B47E48E5ABED7DE6BA51A@denny","threadId":"25753","inReplyTo":null,"subject":"Setting up Git Server over SSH","fromName":"Dennis","fromEmail":"dennisfm@friendlymatch.com","sentAt":"2010-11-15T18:20:15Z","receivedAt":"2010-11-15T18:20:15Z","isPatch":false,"sender":{"key":"dennisfm@friendlymatch.com","avatar":null},"body":"I have a remote server (hostname.com) that acts as a webserver.\nWhat I did is I wanted to set up my public_html folder as a public \nrepository.\nAfter trial and error I am still at stage_0.\n\nThus, on that server I have /home/user/.git directory and the repo works \nfine if I am accessing it from the server.\n\nNow, I want to clone that repo onto my local machine.\nI am doing this, but it fails:\n\n>git clone ssh://hostname.com:/home/user/.git\nCloning into user...\nfatal: protocol error: bad line length character: logi\n\n>Access denied\nAccess denied\nAccess denied\nAccess denied\nAccess denied\nAccess denied\nFATAL ERROR: Server sent disconnect message\ntype 2 (protocol error):\n\"Too many authentication failures for \"\n--------------------------------\n\nWhat can I do to make it work?\nDennis\n"},{"id":"155935","messageId":"AANLkTimF2N-rYFYjOMm5kRRqRueLnmzJGpUoaCK3jsAC@mail.gmail.com","threadId":"25753","inReplyTo":"B99C7057496B47E48E5ABED7DE6BA51A@denny","subject":"Re: Setting up Git Server over SSH","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2010-11-15T18:38:21Z","receivedAt":"2010-11-15T18:38:21Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"On Mon, Nov 15, 2010 at 10:20 AM, Dennis <dennisfm@friendlymatch.com> wrote:\n> I am doing this, but it fails:\n>\n>> git clone ssh://hostname.com:/home/user/.git\n>\n> Cloning into user...\n> fatal: protocol error: bad line length character: logi\n\nThis looks to me like your server is echoing back text upon login.\nThat text is being confused for Git protocol data by the Git client,\nbut its not as expected, so it aborts with an error message.\n\nTry getting the simple case to work first:\n\n  ssh hostname.com echo hello\n\nThis should *only* print \"hello\".  If it prints anything else (and\nright now I suspect it prints \"login ...\"), that will confuse Git.\nYou need to adjust your server's shell login scripts to stop echoing\ninformation during a non-interactive shell.  Or you may need to adjust\nyour SSH client to ensure the authentication proceeds smoothly.  Those\n\"Access denied\" errors look like you aren't actually authenticating to\nthe server.\n\n-- \nShawn.\n"},{"id":"155940","messageId":"E698106BE2EB405A93D2C3304AF79529@denny","threadId":"25753","inReplyTo":"AANLkTimF2N-rYFYjOMm5kRRqRueLnmzJGpUoaCK3jsAC@mail.gmail.com","subject":"Re: Setting up Git Server over SSH","fromName":"Dennis","fromEmail":"dennisfm@friendlymatch.com","sentAt":"2010-11-15T19:14:46Z","receivedAt":"2010-11-15T19:14:46Z","isPatch":false,"sender":{"key":"dennisfm@friendlymatch.com","avatar":null},"body":"Thanks, that worked\n\nI used OpenSSH instead of Putty\nand that fixed things up.\n\nDennis\n\n\n----- Original Message ----- \nFrom: \"Shawn Pearce\" <spearce@spearce.org>\nTo: \"Dennis\" <dennisfm@friendlymatch.com>\nCc: <git@vger.kernel.org>\nSent: Monday, November 15, 2010 1:38 PM\nSubject: Re: Setting up Git Server over SSH\n\n\n> On Mon, Nov 15, 2010 at 10:20 AM, Dennis <dennisfm@friendlymatch.com> \n> wrote:\n>> I am doing this, but it fails:\n>>\n>>> git clone ssh://hostname.com:/home/user/.git\n>>\n>> Cloning into user...\n>> fatal: protocol error: bad line length character: logi\n>\n> This looks to me like your server is echoing back text upon login.\n> That text is being confused for Git protocol data by the Git client,\n> but its not as expected, so it aborts with an error message.\n>\n> Try getting the simple case to work first:\n>\n>  ssh hostname.com echo hello\n>\n> This should *only* print \"hello\".  If it prints anything else (and\n> right now I suspect it prints \"login ...\"), that will confuse Git.\n> You need to adjust your server's shell login scripts to stop echoing\n> information during a non-interactive shell.  Or you may need to adjust\n> your SSH client to ensure the authentication proceeds smoothly.  Those\n> \"Access denied\" errors look like you aren't actually authenticating to\n> the server.\n>\n> -- \n> Shawn. \n"},{"id":"155991","messageId":"AANLkTimTcnTLLsiLAQZn2EiswB_NAfwru6PX1Vw-kFUW@mail.gmail.com","threadId":"25753","inReplyTo":"E698106BE2EB405A93D2C3304AF79529@denny","subject":"Re: Setting up Git Server over SSH","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-11-16T10:46:01Z","receivedAt":"2010-11-16T10:46:01Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Nov 15, 2010 at 20:14, Dennis <dennisfm@friendlymatch.com> wrote:\n> I used OpenSSH instead of Putty\n> and that fixed things up.\n\nDoes using Putty with this at the top of your .bashrc fix it too:\n\n    if [[ $- != *i* ]] ; then\n        # Shell is non-interactive.  Be done now!\n        return\n    fi\n\n?\n"},{"id":"156028","messageId":"FA103D605D674AA388413F9C31489E47@denny","threadId":"25753","inReplyTo":"AANLkTimTcnTLLsiLAQZn2EiswB_NAfwru6PX1Vw-kFUW@mail.gmail.com","subject":"Re: Setting up Git Server over SSH","fromName":"Dennis","fromEmail":"dennisfm@friendlymatch.com","sentAt":"2010-11-17T02:25:43Z","receivedAt":"2010-11-17T02:25:43Z","isPatch":false,"sender":{"key":"dennisfm@friendlymatch.com","avatar":null},"body":"I reinstalled git package with putty and it worked okay this time.\nIt did print this line though before normal output:\nstdin: is not a tty\nremote: Counting objects: 1194, done.\n...\n\nI tweaked bash setting and it did not seem to do anything.  But then I am on \nWindows XP, so not sure if it will work the same way or if I edited the \nright file.\n\nDennis\n\n\n----- Original Message ----- \nFrom: \"Ævar Arnfjörð Bjarmason\" <avarab@gmail.com>\nTo: \"Dennis\" <dennisfm@friendlymatch.com>\nCc: \"Shawn Pearce\" <spearce@spearce.org>; <git@vger.kernel.org>\nSent: Tuesday, November 16, 2010 5:46 AM\nSubject: Re: Setting up Git Server over SSH\n\n\n> On Mon, Nov 15, 2010 at 20:14, Dennis <dennisfm@friendlymatch.com> wrote:\n>> I used OpenSSH instead of Putty\n>> and that fixed things up.\n>\n> Does using Putty with this at the top of your .bashrc fix it too:\n>\n>    if [[ $- != *i* ]] ; then\n>        # Shell is non-interactive.  Be done now!\n>        return\n>    fi\n>\n> ? \n"}]}