[lxc-devel] FW: [PATCH] Add Dropbear SSH support for lxc-busybox template
Stéphane Graber
stgraber at ubuntu.com
Tue Jan 15 17:23:15 UTC 2013
On 01/14/2013 09:37 AM, Stéphane Graber wrote:
> Forwarding this from Bogdan as for some weird reason his e-mails are put
> in the mailing-list moderation queue (even though he's subscribed).
>
> Personally I think this change is good and would make the busybox
> template behave similarly than the others where SSH is usually
> automatically enabled.
>
> But I'm not actually using that template so I'd prefer if someone
> actually using it could give their opinion on whether they're fine with
> this behaviour by default or would rather have it moved behind a command
> line option to the template.
>
> -----Original Message-----
> From: Purcareata Bogdan-B43198 Sent: Monday, January 14, 2013 11:51 AM
> To: 'lxc-users at lists.sourceforge.net'
> Subject: FW: [PATCH] Add Dropbear SSH support for lxc-busybox template
>
> Hello,
>
> I've sent this patch to lxc-devel and received a notification of pending
> for approval from a maintainer. Since I didn't receive any answer yet, I
> was not sure it was the right place.
>
> Bogdan P.
>
>
> -----Original Message-----
> From: Purcareata Bogdan-B43198 Sent: Thursday, January 10, 2013 2:23 PM
> To: 'lxc-devel at lists.sourceforge.net'
> Subject: [PATCH] Add Dropbear SSH support for lxc-busybox template
>
> Dropbear implements lightweight SSH2 server and client functionality and
> is likely to be included in embedded Linux distros.
>
> Patch is done against staging branch.
>
> Bogdan P.
Added proper Signed-off-line, fixed the patch to apply (was mangled by
the few forwards) and applied to staging.
Acked-by: Stéphane Graber <stgraber at ubuntu.com>
> diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in index
> f2751d8..014aac4 100644
> --- a/templates/lxc-busybox.in
> +++ b/templates/lxc-busybox.in
> @@ -33,7 +33,9 @@ $rootfs/root \
> $rootfs/etc \
> $rootfs/etc/init.d \
> $rootfs/bin \
> +$rootfs/usr/bin \
> $rootfs/sbin \
> +$rootfs/usr/sbin \
> $rootfs/proc \
> $rootfs/mnt \
> $rootfs/tmp \
> @@ -63,6 +65,8 @@ $rootfs/usr/lib64"
> chmod 600 ram0 || res=1
> mknod null c 1 3 || res=1
> chmod 666 null || res=1
> + mknod urandom c 1 9 || res=1
> + chmod 666 urandom || res=1
>
> popd > /dev/null
>
> @@ -188,6 +192,36 @@ configure_busybox()
> echo "setting root passwd to root"
> echo "root:root" | chroot $rootfs chpasswd
>
> +
> + # add ssh functionality if dropbear package available on host
> + type dropbear >/dev/null
> + if [ $? -eq 0 ]; then
> + # copy dropbear binary
> + cp $(which dropbear) $rootfs/usr/sbin
> + if [ $? -ne 0 ]; then
> + echo "Failed to copy dropbear in the rootfs"
> + return 1
> + fi
> +
> + # make symlinks to various ssh utilities
> + utils="\
> + $rootfs/usr/bin/dbclient \
> + $rootfs/usr/bin/scp \
> + $rootfs/usr/bin/ssh \
> + $rootfs/usr/sbin/dropbearkey \
> + $rootfs/usr/sbin/dropbearconvert \
> + "
> + echo $utils | xargs -n1 ln -s /usr/sbin/dropbear
> +
> + # add necessary config files
> + mkdir $rootfs/etc/dropbear
> + dropbearkey -t rsa -f
> $rootfs/etc/dropbear/dropbear_rsa_host_key &> /dev/null
> + dropbearkey -t dss -f +
> $rootfs/etc/dropbear/dropbear_dss_host_key &> /dev/null
> +
> + echo "'dropbear' ssh utility installed"
> + fi
> +
> return 0
> }
>
>
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122412
>
>
>
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
>
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20130115/336729f4/attachment.pgp>
More information about the lxc-devel
mailing list