센트 5.1 사용중입니다.
1. 바이너리로 설치된 SSH 삭제
2. ./configure --exec-prefix=/usr --sysconfdir=/etc/ssh --with-pam --without-zlib-version-check
3. make -> make install
4.
mkdir -p etc etc/profile.d etc/sysconfig bin sbin lib usr/bin /usr/sbin usr/lib usr/libexec usr/share dev
mknod dev/null c 1 3
mknod dev/zero c 1 5
chmod +666 dev/{null,zeero}
- 필요한 파일 복사
cp -avf /bin/{basename,cat,csh,hostname,mkdir,ping,rm,sh,vi,bash,cp,egrep,ls,mv,pwd,rmdir,tcsh,view} bin/
cp -avf /sbin/consoletype sbin/
cp -avf /usr/bin/{dircolors,du,groups,id,mesg,whoami} usr/bin/
cp -avf /usr/libexec/{openssh,sftp-server,ssh-keysign} usr/libexec/
cp -avf /usr/share/{terminfo,vim} usr/share/
cp -avf /etc/{bashrc,DIR_COLORS.xterm,inputrc,profile,vimrc,DIR_COLORS,termcap} etc/
cp -avf /etc/profile.d/{colorls.csh,colorls.sh,lang.csh,lang.sh,less.csh,less.sh} etc/profile.d/
cp -avf /etc/sysconfig/i18n etc/sysconfig/
5.
echo '#!/bin/bash' > usr/bin/groups
echo "id -Gn" >> usr/bin/groups
chmod +x usr/bin/groups
touch etc/passwd
grep /etc/passwd -e "^root" -e "^test" > etc/passwd
grep /etc/group -e "^root" -e "^test" > etc/group
여기까지는 기존 인터넷 보고 그데로 따라한것입니다.
5번과정에서 test라는 유저를 추가했고
/chroot/etc/passwd 내용입니다.
root:x:0:0:root:/root:/bin/bash
test:x:501:501::/home/test:/bin/bash
/etc/passwd 내용이빈다.
..
생략
test:x:501:501::/chroot/./home/test:/bin/bash
--
이렇케 했는데
test로 접속할경우 putty가 그냥 꺼집니다 ..
다른 계정으로 접속해서 su 로 할경우는
chroot가 잡혀있지 않은 상태가 됩니다..
조언좀 부탁드려요 ㅜㅜ
눈팅만으로는 답변글을 볼 수 없습니다. 로그인하셔야 합니다.