Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id DF5A12231CE for <~alpine/users@lists.alpinelinux.org>; Thu, 7 Sep 2023 14:51:51 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id C07AF5C0139 for <~alpine/users@lists.alpinelinux.org>; Thu, 7 Sep 2023 10:51:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 07 Sep 2023 10:51:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t=1694098309; x=1694184709; bh=k2CaUAPthbvlN/dBC/5RCQw3y tBBwELRiBbssmTA8No=; b=GK/FBpfD/4NVK+3ccnRGEri+Zp9Eb1AnmotaGqKv5 Wt8irKZWtZZWjPEEN8A+h2E8RsR227Od+kRFXVlqNLAXKN+ymVUaG4CYer7W5nW9 Rjs03GIZn2CNrzer9bZEP33TKEYsuyMhtQ415khGtpdpfWW0Bv4gJa6IzRa7OICO UHUw4gm5m+LB3+ahQw0gUaiJwzMVhAjHnKb6tpneAALw2MFTCUKW9dphjWr8NTUB SKUGN0dzPCJaWN19M1QEx5HipYp5+sUtlRXWYwIF80fk3M3dwKt6VSvJwyiTrfve VBxjV6SezEurKfo0LRheNk4JbmHylccoWLPNkp9wQNeSQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1694098309; x=1694184709; bh=k2CaUAPthbvlN/dBC/5RCQw3ytBBwELRiBb ssmTA8No=; b=w+OakTg+F+L9G6jna9QXi44K5s0uOeUdk6O14IHB5NhtOnV57tC m9aiwf+UmpddAZmSX+gKY4N9S44hcsLtj9cc7R3Dojk/FaKZjXtTVtGP9XjScXuq vmGC8sZWnmy6DHimAmMlqsOjL9JVt875tjSHo7aQ5W7PxFtAzjAB6GwFBIce4+s5 VJP3RFSevg1+gwLG25ET8AOPjCraCWWu2JW9pToOpMOVSfdO9zeem6M6JvySKsUs Kz+PmxFEQ7lkPot+EdgybRzrjQWI5boRFiJpfbIulG42GtgzSrj+6rgl1x4L7+7E OUXSW9RnpNWI2ba35JWR23AkPyx+iPiyR6g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehhedgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhtggguffkfffvofesrgdtmherhh dtjeenucfhrhhomhepgggrlhgvnhhtihhnucfvuhhnvghvuceovhhlthhtnhhvsehfrghs thhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepgfevheetueekfeefvdfhgfevge eifffhueekheeuieeugfdtheehtdelgfehjeelnecuffhomhgrihhnpehprghsthgvsghi nhdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehvlhhtthhnvhesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: id461471d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for <~alpine/users@lists.alpinelinux.org>; Thu, 7 Sep 2023 10:51:49 -0400 (EDT) From: Valentin Tunev Content-Type: multipart/alternative; boundary="Apple-Mail=_833FEB7B-478D-4074-82E3-AE3E047F3BB5" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Setting up SSH server inside docker Message-Id: Date: Thu, 7 Sep 2023 17:51:37 +0300 To: ~alpine/users@lists.alpinelinux.org X-Mailer: Apple Mail (2.3731.600.7) --Apple-Mail=_833FEB7B-478D-4074-82E3-AE3E047F3BB5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hello everyone, I have stumbled across an odd issue when trying to set up an SSH server = using Alpine as a base for a docker image. I am getting a "git@localhost: Permission denied (publickey).=E2=80=9D = error, although the correct key is inside athorized_keys. I have also = set the correct permissions for the directories. After a lot of debugging if found out that I recreate the set up = (install git, openssh, create bare repo) for the root user I am able to = clone, ssh into the server etc. But as soon as I create a new user = =E2=80=9Cgit=E2=80=9D and set up a bare repository and authorized_keys I = start getting the permissions error. The logs from the ssh server don=E2=80=99t show anything interesting, = just that the public key is being rejected. Logs on the client side show = the same. Here=E2=80=99s my Dockerfile: https://pastebin.com/jPLqJfQc I would appreciate any pointers because I am not sure what to debug any = more. Thanks, Val= --Apple-Mail=_833FEB7B-478D-4074-82E3-AE3E047F3BB5 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hello = everyone,

I have stumbled across an odd issue when = trying to set up an SSH server using Alpine as a base for a docker = image.
I am getting a "git@localhost: Permission denied = (publickey).=E2=80=9D error, although the correct key is inside = athorized_keys. I have also set the correct permissions for the = directories.

After a lot of debugging if found = out that I recreate the set up (install git, openssh, create bare repo) = for the root user I am able to clone, ssh into the server etc. But as = soon as I create a new user =E2=80=9Cgit=E2=80=9D and set up a bare = repository and authorized_keys I start getting the permissions = error.

The logs from the ssh server don=E2=80=99t= show anything interesting, just that the public key is being rejected. = Logs on the client side show the same.

Here=E2=80= =99s my Dockerfile: https://pastebin.com/jPLqJfQc

I would appreciate any pointers because I am not = sure what to debug any = more.

Thanks,
Val
= --Apple-Mail=_833FEB7B-478D-4074-82E3-AE3E047F3BB5--