[yocto] Fwd: OpenSSH pre login banner

Bryan Evenson bevenson at melinkcorp.com
Thu Oct 3 05:19:14 PDT 2013


Amit,

>From your message, I'm assuming you have a bbappend file for openssh.  Following the example in section of 5.1.4 of the Mega Manual (located at http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#using-bbappend-files) and from personal experience, put the following in your bbappend file:

FILESEXTRAPATHS_prepend := " ${THISDIR}: "
SRC_URI += " file://banner "
FILES_${PN} += " /etc/ssh/banner "

do_install_append() {
                install -d ${D}${sysconfdir}/ssh
                install -m 0644 ${WORKDIR}/banner ${D}${sysconfdir/ssh/banner
}
PRINC := "${@int(PRINC) + 1}"

then place your banner file and sshd_config in the same directory as your bbappend.  When openssh gets built, Bitbake will find your sshd_config first and use and install that file instead of the one from the main layer.  The recipe also tells it how to handle the new banner file that is not part of the original recipe; you do not need to put these rules in place for sshd_config because that is already part of the original recipe.  Then in the future every time you make a change to the openssh package in your layer, increment the PRINC so your package management tools will see it as an upgrade.  For example, if you change the contents of the banner file, then change the "+ 1" to "+ 2".

-Bryan

From: yocto-bounces at yoctoproject.org [mailto:yocto-bounces at yoctoproject.org] On Behalf Of Amit Tomer
Sent: Thursday, October 03, 2013 7:05 AM
To: yocto at yoctoproject.org
Subject: [yocto] Fwd: OpenSSH pre login banner


---------- Forwarded message ----------
From: Amit Tomer <amittomer25 at gmail.com<mailto:amittomer25 at gmail.com>>
Date: Thu, Oct 3, 2013 at 1:50 PM
Subject: OpenSSH pre login banner
To: "yocto-request at yoctoproject.org<mailto:yocto-request at yoctoproject.org>" <yocto-request at yoctoproject.org<mailto:yocto-request at yoctoproject.org>>

I am new to OpenEmbedded Yocto and have a requirement where OpenSSH pre login banner
should come when do ssh from target board

Now I know I have to create a simple .txt file(banner) and put my banner in to it and add the following to sshd_config

Banner /etc/ssh/banner

But now  wanted to know where should I keep my banner file in yocto so that Yocto build infrastructure will pack banner file  to /etc/ssh/banner into final image.

I do have receipes for openssh in meta-xyz/recipes-connectivity/openssh  folder

Thanks
Amit




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20131003/60b3cbf7/attachment.html>


More information about the yocto mailing list