All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Erik Botö" <erik.boto@gmail.com>
To: Nicolas Jeker <n.jeker@delisys.ch>
Cc: VIVAVIS AG <embedded@vivavis.com>,
	Sourabh Hegde <hrsourabh011@gmail.com>,
	"yocto@lists.yoctoproject.org" <yocto@lists.yoctoproject.org>
Subject: Re: [yocto] Fetch private gitlab repo using ssh with Yocto recipe #bitbake
Date: Fri, 28 Jan 2022 13:33:05 +0100	[thread overview]
Message-ID: <CALNvYWM+E4huNkdZL5MNnDiC3D9aVy7SvziooFfqRR5Qr-TXnA@mail.gmail.com> (raw)
In-Reply-To: <90997c2cb92ea9700451b0e5d9afaeef64f4662c.camel@delisys.ch>

On Fri, Jan 28, 2022 at 11:50 AM Nicolas Jeker <n.jeker@delisys.ch> wrote:
>
> On Fri, 2022-01-28 at 10:27 +0000, VIVAVIS AG wrote:
> > Hi,
> >
> > > Von: yocto@lists.yoctoproject.org <yocto@lists.yoctoproject.org> Im
> > > Auftrag von Sourabh Hegde
> > > Gesendet: Freitag, 28. Januar 2022 10:47
> > >
> > > Can you please let me know how to "forward SSH_AGENT into it to be
> > > able
> > > to fetch from internal projects without the need to mount the key
> > > into the container."? I never did that before.
> >
> > I use the following options within the Docker run command:
> >   -v $SSH_AUTH_SOCK:/ssh.socket \
> >   -e SSH_AUTH_SOCK=/ssh.socket \
> >
>
> That's pretty much what I use.
>
> > Furthermore, I had to mount the .ssh folder into the container to
> > make it working (be aware of security risk).
> > Additionally, you should check that uid, gid of the user in the
> > container is the same on the host.
>
> I do something similar, my "problem" was that ssh needs the
> .ssh/known_hosts file with a matching entry in addition to your
> key/agent, but mounting the .ssh folder was not possible for me because
> of permissions. Currently, I just created a little script that wraps
> "oe-init-build-env" and populates the known_hosts file accordingly.
>
> mkdir -p ~/.ssh
>
> cat <<EOF >> ~/.ssh/known_hosts
> git.example.com ssh-ed25519 <base64key>
> EOF
>

I use my own Dockerfile based on crops/poky where I do the following,
which might be helpful if you also use this. It sets up the config
changes in /etc/skel/ since it creates users "on the fly" with
matching uid.

# Remove strict host key checking for ssh
# This is needed since the build will pull source over git-ssh
RUN mkdir -p /etc/skel/.ssh/
COPY ci-scripts/docker-stuff/config /etc/skel/.ssh/
RUN echo 'export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null
-o StrictHostKeyChecking=no"' >> /etc/skel/.bashrc


The ci-scripts/docker-stuff/config file contains:
Host *
   StrictHostKeyChecking no
   UserKnownHostsFile=/dev/null

Now it was ages ago I set this up, and right now I can't really
understand why I basically do the same thing twice. So you'd have to
check which of the two things that actually solves the issue :-)

Cheers,
Erik


> > Regards,
> >
> > Carsten
> >
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#56009): https://lists.yoctoproject.org/g/yocto/message/56009
> Mute This Topic: https://lists.yoctoproject.org/mt/88691891/3618217
> Mute #bitbake:https://lists.yoctoproject.org/g/yocto/mutehashtag/bitbake
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [erik.boto@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


  parent reply	other threads:[~2022-01-28 12:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26  7:16 Fetch private gitlab repo using ssh with Yocto recipe #bitbake hrsourabh011
     [not found] ` <664d7ef6f28584b0d7310774ad48660437562589.camel@delisys.ch>
2022-01-28  9:46   ` [yocto] " Sourabh Hegde
2022-01-28 10:27     ` AW: " embedded (VIVAVIS AG)
     [not found]       ` <90997c2cb92ea9700451b0e5d9afaeef64f4662c.camel@delisys.ch>
2022-01-28 12:33         ` Erik Botö [this message]
2022-01-28 17:37       ` Khem Raj
2022-01-31 10:54         ` Sourabh Hegde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALNvYWM+E4huNkdZL5MNnDiC3D9aVy7SvziooFfqRR5Qr-TXnA@mail.gmail.com \
    --to=erik.boto@gmail.com \
    --cc=embedded@vivavis.com \
    --cc=hrsourabh011@gmail.com \
    --cc=n.jeker@delisys.ch \
    --cc=yocto@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.