FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 07-14-2011, 02:43 PM
Trey Dockendorf
 
Default Chroot issue with username to uid

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...

Last login: Thu Jul 14 09:04:14 2011 from ....id: cannot find name for group ID 507id: cannot find name for user ID 506[I have no name!@webserver ~]$*

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?
Here's how I setup the chroot...I'll provide a full write up once I get this last issue fixed...

cd /home/mkdir chrootcd chroot/groupadd chrootusersuseradd treydockusermod -a -G chrootusers treydock
mkdir -p ./{dev,etc,lib,lib64,usr,bin,home}
mkdir -p ./usr/{bin,libexec}mkdir -p usr/libexec/opensshmknod -m 666 dev/null c 1 3
cp -R /etc/skel home/treydockchown -R treydock:treydock /home/chroot/home/treydock


cp /etc/ld.so.cache /home/chroot/etc/cp /etc/ld.so.conf /home/chroot/etc/cp -R /etc/ld.so.conf.d /home/chroot/etc/cp /etc/nsswitch.conf /home/chroot/etc/
cp /etc/hosts /home/chroot/etc/cp /etc/passwd /home/chroot/etc/cp /etc/group /home/chroot/etc/cp /etc/resolv.conf /home/chroot/etc/cp /etc/bashrc /home/chroot/etc/

cp /bin/vi /home/chroot/bin/cp /bin/ls /home/chroot/bin/cp /bin/cat /bin/cp /bin/grep /bin/mkdir /bin/mv /bin/rm /bin/rmdir /bin/bash /home/chroot/bin/
cp /usr/bin/scp /home/chroot/usr/bin/
cp /usr/bin/sftp /home/chroot/usr/bin/cp /usr/bin/ssh /home/chroot/usr/bin/cp /usr/bin/vim /home/chroot/usr/bin/cp /usr/bin/id /home/chroot/usr/bin/
cp /usr/libexec/openssh/sftp-server /home/chroot/usr/libexec/openssh/

cd /usr/local/sbin/wget -O l2chroot http://www.cyberciti.biz/files/lighttpd/l2chroot.txtchmod +x l2chroot*
vim l2chroot*

for i in `ls /home/chroot/bin/`; do l2chroot /bin/$i; donefor i in `ls /home/chroot/usr/bin/`; do l2chroot /usr/bin/$i; donel2chroot /usr/libexec/openssh/sftp-server*


vim /etc/ssh/sshd_config/etc/init.d/sshd restart
Here is an example of what is in both my system and chroot /etc/passwd

treydock:x:506:507:Trey Dockendorf:/home/treydock:/bin/bash
Thanks- Trey

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 03:02 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org