I'm setting up a chroot environment on a shared web server to allow users to modify their web roots within a secure chroot, but am having a problem. Right now when I log in with test accounts I get this...<div><br></div>
<div><div>Last login: Thu Jul 14 09:04:14 2011 from ....</div><div>id: cannot find name for group ID 507</div><div>id: cannot find name for user ID 506</div><div>[I have no name!@webserver ~]$ </div></div><div><br></div><div>
I've verified that the UID / GIDs are correct in the chroot's /etc/passwd. Is there possibly something I may have not put in the chroot that is needed for id->name mapping?</div><div><br></div><div>Here's how I setup the chroot...I'll provide a full write up once I get this last issue fixed...</div>
<div><br></div><div><div>cd /home/</div><div>mkdir chroot</div><div>cd chroot/</div><div>groupadd chrootusers</div><div>useradd treydock</div><div>usermod -a -G chrootusers treydock</div><div><br></div><div>mkdir -p ./{dev,etc,lib,lib64,usr,bin,home}</div>
<div>mkdir -p ./usr/{bin,libexec}</div><div>mkdir -p usr/libexec/openssh</div><div>mknod -m 666 dev/null c 1 3</div><div><br></div><div>cp -R /etc/skel home/treydock</div><div>chown -R treydock:treydock /home/chroot/home/treydock</div>
<div><br></div><div><br></div><div>cp /etc/ld.so.cache /home/chroot/etc/</div><div>cp /etc/ld.so.conf /home/chroot/etc/</div><div>cp -R /etc/ld.so.conf.d /home/chroot/etc/</div><div>cp /etc/nsswitch.conf /home/chroot/etc/</div>
<div>cp /etc/hosts /home/chroot/etc/</div><div>cp /etc/passwd /home/chroot/etc/</div><div>cp /etc/group /home/chroot/etc/</div><div>cp /etc/resolv.conf /home/chroot/etc/</div><div>cp /etc/bashrc /home/chroot/etc/</div><div>
<br></div><div>cp /bin/vi /home/chroot/bin/</div><div>cp /bin/ls /home/chroot/bin/</div><div>cp /bin/cat /bin/cp /bin/grep /bin/mkdir /bin/mv /bin/rm /bin/rmdir /bin/bash /home/chroot/bin/</div><div><br></div><div>cp /usr/bin/scp /home/chroot/usr/bin/</div>
<div>cp /usr/bin/sftp /home/chroot/usr/bin/</div><div>cp /usr/bin/ssh /home/chroot/usr/bin/</div><div>cp /usr/bin/vim /home/chroot/usr/bin/</div><div>cp /usr/bin/id /home/chroot/usr/bin/</div><div><br></div><div>cp /usr/libexec/openssh/sftp-server /home/chroot/usr/libexec/openssh/</div>
<div><br></div><div>cd /usr/local/sbin/</div><div>wget -O l2chroot <a href="http://www.cyberciti.biz/files/lighttpd/l2chroot.txt">http://www.cyberciti.biz/files/lighttpd/l2chroot.txt</a></div><div>chmod +x l2chroot </div>
<div>vim l2chroot </div><div><br></div><div><br></div><div>for i in `ls /home/chroot/bin/`; do l2chroot /bin/$i; done</div><div>for i in `ls /home/chroot/usr/bin/`; do l2chroot /usr/bin/$i; done</div><div>l2chroot /usr/libexec/openssh/sftp-server </div>
<div><br></div><div><br></div><div>vim /etc/ssh/sshd_config</div><div>/etc/init.d/sshd restart</div></div><div><br></div><div>Here is an example of what is in both my system and chroot /etc/passwd</div><div><br></div><div>
<div>treydock:x:506:507:Trey Dockendorf:/home/treydock:/bin/bash</div></div><div><br></div><div>Thanks</div><div>- Trey</div><div><br></div>