[ale] Using a namespace to manage a chroot.

Chris Fowler cfowler at outpostsentinel.com
Wed May 12 08:42:35 EDT 2021


Called "Thank you sir, may I please have another?" because I get bit in the a$$.

I left '-march=native' in the config of busybox and it took me a while to figure out why I was getting 'Illegal Instruction' on a Digital Ocean droplet after I deployed the disti.

As a side note, I was able to deploy the LFS 7.7 as a custom image droplet after I did some work to mimic 'centos'.  Cloud Init tries to detect the disiti so it can do what it needs to do to set IP, keys, etc.

________________________________
From: Ale <ale-bounces at ale.org> on behalf of Steve Litt via Ale <ale at ale.org>
Sent: Tuesday, May 11, 2021 4:59 AM
To: ale at ale.org <ale at ale.org>
Cc: Steve Litt <slitt at troubleshooters.com>
Subject: Re: [ale] Using a namespace to manage a chroot.

Chris Fowler via Ale said on Sun, 9 May 2021 20:47:50 +0000

>For years I've been running SSH via chroot inside Linux installs on my
>workstation regardless of the version of Ubuntu the workstation
>currently runs.  This allows me to upgrade my workstation, while still
>compiling code inside a CentOS distribution.
>
>At boot I'll do something like this to prepare each chroot.
>
>START_PORT=55;
>for ii in CentOS-5-1 CentOS5-2 LFS-7.7; do
>  for iii in dev dev/pts proc sys; do
>    TEMPLATE="/opt/devel/${ii}"
>     mount -o bind /${iii} ${TEMPLATE}/${ii}
>     sed -i 's#^Port 22.*$#Port '${START_PORT}'#g'
> ${TEMPLATE}/etc/ssh/sshd_config chroot ${TEMPLATE}/${ii}
> /etc/init.d/sshd start START_PORT=$(( ${START_PORT} + 1 ))
>  done
>done
>
>After boot,  My Ubuntu 18.04 workstation will be running 3 other
>distributions.  I'll use SSH to access them as a regular user.  Tmux
>automatically runs on first login, other logins will attach to that
>session.

This is cool as hell. I don't fully understand it, but I like it.
And it looks like it would be handy for other things besides chroot
installations. Would you be able to give an online presentation of this
at the next GoLUG online meeting, via Jitsi, at 7pm the first Wednesday
of June?

Thanks,

SteveT

Steve Litt
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques
_______________________________________________
Ale mailing list
Ale at ale.org
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.ale.org/pipermail/ale/attachments/20210512/b0cc38fb/attachment.htm>


More information about the Ale mailing list