<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: chroot in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102350#M30732</link>
    <description>Configure a chroot environment is not that easy, you must create the directory structure required and the programs to be used.&lt;BR /&gt;&lt;BR /&gt;Please see:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1119613" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1119613&lt;/A&gt;</description>
    <pubDate>Wed, 14 Nov 2007 08:58:11 GMT</pubDate>
    <dc:creator>Ivan Ferreira</dc:creator>
    <dc:date>2007-11-14T08:58:11Z</dc:date>
    <item>
      <title>chroot</title>
      <link>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102349#M30731</link>
      <description>Hi there&lt;BR /&gt;I'm tryin to jail user in hs home directory but it's firs time I'm playing eith chroot.&lt;BR /&gt;I'm still having cannot run command `/bin/bash': No such file or directory&lt;BR /&gt;error.&lt;BR /&gt;&lt;BR /&gt;Please help&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;root@loadb1:/# chroot /home/madmin/&lt;BR /&gt;chroot: cannot run command `/bin/bash': No such file or directory&lt;BR /&gt;root@loadb1:/# cp -R /bin/ /home/madmin/&lt;BR /&gt;root@loadb1:/# chroot /home/madmin/&lt;BR /&gt;chroot: cannot run command `/bin/bash': No such file or directory&lt;BR /&gt;root@loadb1:/# chown madmin:madmin /home/madmin/bin/&lt;BR /&gt;root@loadb1:/# chown madmin:madmin /home/madmin/bin/*&lt;BR /&gt;chown: changing ownership of `/home/madmin/bin/lsmod.modutils': No such file or directory&lt;BR /&gt;chown: changing ownership of `/home/madmin/bin/pidof': No such file or directory&lt;BR /&gt;root@loadb1:/# chmod 775 /home/madmin/bin/&lt;BR /&gt;root@loadb1:/# chmod 775 /home/madmin/bin/*&lt;BR /&gt;root@loadb1:/# chroot /home/madmin/&lt;BR /&gt;chroot: cannot run command `/bin/bash': No such file or directory&lt;BR /&gt;root@loadb1:/#</description>
      <pubDate>Wed, 14 Nov 2007 08:29:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102349#M30731</guid>
      <dc:creator>Piotr Kirklewski</dc:creator>
      <dc:date>2007-11-14T08:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: chroot</title>
      <link>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102350#M30732</link>
      <description>Configure a chroot environment is not that easy, you must create the directory structure required and the programs to be used.&lt;BR /&gt;&lt;BR /&gt;Please see:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1119613" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1119613&lt;/A&gt;</description>
      <pubDate>Wed, 14 Nov 2007 08:58:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102350#M30732</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2007-11-14T08:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: chroot</title>
      <link>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102351#M30733</link>
      <description>To be hones I don't want to create new directories. I want to jail existing user in his existing direcotry (/home/madmin) so he cannot reach real root dir or other users directories.&lt;BR /&gt;&lt;BR /&gt;How am I doing that ?&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt; &lt;BR /&gt;Peter</description>
      <pubDate>Wed, 14 Nov 2007 09:46:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102351#M30733</guid>
      <dc:creator>Piotr Kirklewski</dc:creator>
      <dc:date>2007-11-14T09:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: chroot</title>
      <link>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102352#M30734</link>
      <description>&amp;gt;&amp;gt;&amp;gt; To be hones I don't want to create new directories.&lt;BR /&gt;&lt;BR /&gt;That is the issue, to be able to run chroot, you need a directory structure in the user's HOME that simulates the root directory, chroot expect to find some files there, just to have one example, it's expecting to find /home/mdadmin/bin/bash among others.&lt;BR /&gt;&lt;BR /&gt;Please see also:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://chrootssh.sourceforge.net" target="_blank"&gt;http://chrootssh.sourceforge.net&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Nov 2007 10:28:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102352#M30734</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2007-11-14T10:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: chroot</title>
      <link>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102353#M30735</link>
      <description>A restricted shell would prevent the user from changing directories, but it would also block a lot of other things.</description>
      <pubDate>Wed, 14 Nov 2007 11:26:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102353#M30735</guid>
      <dc:creator>Heironimus</dc:creator>
      <dc:date>2007-11-14T11:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: chroot</title>
      <link>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102354#M30736</link>
      <description>Here's step by step what I did:&lt;BR /&gt;&lt;BR /&gt;cd /tmp&lt;BR /&gt;wget &lt;A href="http://www.zlib.net/zlib-1.2.3.tar.gz" target="_blank"&gt;http://www.zlib.net/zlib-1.2.3.tar.gz&lt;/A&gt;&lt;BR /&gt;tar xvfz zlib-1.2.3.tar.gz&lt;BR /&gt;cd zlib-1.2.3&lt;BR /&gt;make clean&lt;BR /&gt;./configure -s&lt;BR /&gt;make&lt;BR /&gt;make install&lt;BR /&gt;cd /tmp&lt;BR /&gt;apt-get install libpam0g-dev openssl libcrypto++-dev libssl0.9.7 libssl-dev ssh&lt;BR /&gt;wget &lt;A href="http://chrootssh.sourceforge.net/download/openssh-4.2p1-chroot.tar.gz" target="_blank"&gt;http://chrootssh.sourceforge.net/download/openssh-4.2p1-chroot.tar.gz&lt;/A&gt;&lt;BR /&gt;tar xvfz openssh-4.2p1-chroot.tar.gz&lt;BR /&gt;cd openssh-4.2p1-chroot&lt;BR /&gt;./configure --exec-prefix=/usr --sysconfdir=/etc/ssh --with-pam&lt;BR /&gt;make&lt;BR /&gt;make install&lt;BR /&gt;&lt;BR /&gt;mkdir /home/chroot/&lt;BR /&gt;mkdir /home/chroot/home/&lt;BR /&gt;cd /home/chroot&lt;BR /&gt;mkdir etc&lt;BR /&gt;mkdir bin&lt;BR /&gt;mkdir lib&lt;BR /&gt;mkdir usr&lt;BR /&gt;mkdir usr/bin&lt;BR /&gt;mkdir dev&lt;BR /&gt;mknod dev/null c 1 3&lt;BR /&gt;mknod dev/zero c 1 5 &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#SCRIPT !!! ###########################&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;APPS="/bin/bash /bin/ls /bin/mkdir /bin/mv /bin/pwd /bin/rm /usr/bin/id /usr/bin/ssh /bin/ping /usr/bin/dircolors"&lt;BR /&gt;for prog in $APPS; do&lt;BR /&gt;cp $prog ./$prog&lt;BR /&gt;&lt;BR /&gt;# obtain a list of related libraries&lt;BR /&gt;ldd $prog &amp;gt; /dev/null&lt;BR /&gt;if [ "$?" = 0 ] ; then&lt;BR /&gt;LIBS=`ldd $prog | awk '{ print $3 }'`&lt;BR /&gt;for l in $LIBS; do&lt;BR /&gt;mkdir -p ./`dirname $l` &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;cp $l ./$l&lt;BR /&gt;done&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;#SCRIPT !!! ###########################&lt;BR /&gt;&lt;BR /&gt;cp /lib/libnss_compat.so.2 /lib/libnsl.so.1 /lib/libnss_files.so.2 ./lib/&lt;BR /&gt;&lt;BR /&gt;echo '#!/bin/bash' &amp;gt; usr/bin/groups&lt;BR /&gt;echo "id -Gn" &amp;gt;&amp;gt; usr/bin/groups&lt;BR /&gt;touch etc/passwd&lt;BR /&gt;grep /etc/passwd -e "^root" &amp;gt; etc/passwd&lt;BR /&gt;grep /etc/group -e "^root" -e "^users" &amp;gt; etc/group&lt;BR /&gt;/etc/init.d/ssh restart &lt;BR /&gt;useradd -s /bin/bash -m -d /home/chroot/./home/testuser -c "testuser" -g users testuser&lt;BR /&gt;passwd testuser&lt;BR /&gt;grep /etc/passwd -e "^testuser" &amp;gt;&amp;gt; /home/chroot/etc/passwd&lt;BR /&gt;cp /lib/ld-linux.so.2 lib/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now it says:&lt;BR /&gt;&lt;BR /&gt;I have no name!@test:~$&lt;BR /&gt;&lt;BR /&gt;instaed : testuser@test&lt;BR /&gt;&lt;BR /&gt;There must be something wrong with /chroot/home/bin/bash.&lt;BR /&gt;&lt;BR /&gt;Any Ideas how to get rid of this problem ?&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;&lt;BR /&gt;Peter &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Nov 2007 11:36:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102354#M30736</guid>
      <dc:creator>Piotr Kirklewski</dc:creator>
      <dc:date>2007-11-19T11:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: chroot</title>
      <link>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102355#M30737</link>
      <description>I know&lt;BR /&gt;&lt;BR /&gt;vim /home/chroot/etc/passwd&lt;BR /&gt;&lt;BR /&gt;and add&lt;BR /&gt;&lt;BR /&gt;testuser:x:1002:100::/home/chroot/./home/testuser:/bin/bash&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;&lt;BR /&gt;Peter&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Nov 2007 11:53:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/chroot/m-p/4102355#M30737</guid>
      <dc:creator>Piotr Kirklewski</dc:creator>
      <dc:date>2007-11-19T11:53:09Z</dc:date>
    </item>
  </channel>
</rss>

