LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-06-2006, 11:13 PM   #1
xdentan
LQ Newbie
 
Registered: May 2006
Posts: 3

Rep: Reputation: 0
Chroot doesn't work?


I'm trying to setup a chrooted enviroment for users that login through ssh. I have installed libpam-chroot and have configured security.conf and added "session required pam_chroot.so debug" to /etc/pam.d/ssh but now when the chrooted user logs in, putty says "Server unexpectedly closed network connection." I have run the setup-chrootdir-shell.sh script to make sure the directory has basic utilities like the shell.

Something else I have noticed when setting this up is that I can't chroot to the directory (or any directory) manually. For example as root I type 'chroot /jail' and it returns 'chroot: cannot run command `/bin/bash': No such file or directory'. I also try 'chroot /jail /bin/bash' and it returns the same message. I don't understand why it says this because /bin/bash exists. Is this a bug or something? I am running Debian 3.1 stable.
 
Old 05-06-2006, 11:41 PM   #2
stop_banning_me
LQ Newbie
 
Registered: May 2006
Posts: 11

Rep: Reputation: 0
i know whats going on. i had that.
basically, when you chroot, your new destination root must contain bash(or an alternative shell which you must specify as an option), your new bin/sbin directories(if you dont have then there is no commands you can run, even ls), and you must have the libraries that bash uses.
read here:
every program/command you have trouble with after you chroot, do:
ldd target_program_with_path
and it will display what i need. and put that in.

as i see you also have issues with ssh(which i had too with ssh set up by default). basically you need to generate a set of "keys" in order for you connection to work.(as i understand the key is needed for encryption)
i went through hell and high water with setting up ssh... it took me so long i cant tell you all the steps. but until your client displays a message whether you want to accept the key, you are no go.
reinstalling ssh should generate the keys automatically for you. thats what i ended up doing i think.
 
Old 05-06-2006, 11:42 PM   #3
stop_banning_me
LQ Newbie
 
Registered: May 2006
Posts: 11

Rep: Reputation: 0
cant post URLs till i make 3 posts. stupid forum rule. read in the next post.
 
Old 05-06-2006, 11:43 PM   #4
stop_banning_me
LQ Newbie
 
Registered: May 2006
Posts: 11

Rep: Reputation: 0
http://www.redhat.com/archives/nahan.../msg00043.html
 
Old 05-07-2006, 12:23 AM   #5
xdentan
LQ Newbie
 
Registered: May 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks a ton. I have been tampering with this all day, can't believe the solution was so simple
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 11:30 AM
LFS Book Chapter 6 - 1st step (chroot to /mnt/lfs) doens't work bauld Linux From Scratch 11 03-15-2006 01:31 AM
AMD64 - 3d accel in a 32bit chroot don't work ssobeht Debian 2 12-22-2005 11:11 AM
chroot wrongman Linux - Security 2 07-15-2004 03:35 AM
chroot how much? ixion Linux - Security 4 05-29-2003 05:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration