Re: Fixes to mkchroot.sh for Ubuntu 12.04.2 LTS precise 64-bit
Brought to you by:
xystrus
From: Russ A. <rr...@st...> - 2013-03-12 16:38:49
|
Gary Barnes <rss...@ad...> writes: > I installed rssh from packages, and used the mkchroot.sh script to create a > chroot jail for a user. The script threw up errors, and when I tried to > connect, I got the "Connection closed" message. > The FAQ says: > "However it seems that on recent Linux distros, the script is missing > something important, and I haven't yet figured out what that is... If you > are able to identify it, please post to the mailing list to let me (and > everyone else) know." > So, to get it to work, I altered the lines that referred to libnss file to > change /lib/ to /lib/x86_64-linux-gnu/ I'm not entirely sure what "installed from packages" refers to -- did you install the rssh package in Ubuntu? The mkchroot.sh script that is shipped with that package (in /usr/share/doc/rssh) should already handle this case correctly via the following: # On Debian with multiarch, the libnss files are in /lib/<triplet>, where # <triplet> is the relevant architecture triplet. Just copy everything # that's installed, since we're not sure which ones we'll need. echo "copying name service resolution libraries..." if [ -n "$(find /lib -maxdepth 1 -name 'libnss*_' -print -quit)" ] ; then tar -cf - /lib/libnss_compat* /lib/libnss*_files* \ | tar -C "$jail_dir" -xvf - | sed 's/^/\t/' else tar -cf - /lib/*/libnss_compat* /lib/*/libnss*_files* \ | tar -C "$jail_dir" -xvf - | sed 's/^/\t/' fi -- Russ Allbery (rr...@st...) <http://www.eyrie.org/~eagle/> |