Linux-Noob Forums

Full Version: ssh and chroots
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

hey everyone, I was looking at the tutorial in the thread pinned at the top. Although it says specifically how to set things up, it doesn't quite answer some questions I had, so bear with me, but I didn't feel like I should ask my questions in that thread.

 

Anyhow, my situation is that I have need of a very specific environment, however I don't want to run that environment on the machine, I'd much rather run it in a chroot and ssh in whenever I need specific use of that environment.

 

To explain things further, right now i'm running some machines that have Debian on them (Etch, the soon to be released debian running in 64bit w/ 2.6.17.6). I have need to run a SuSE 8.0 environment from time to time for a variety of legacy reasons.

 

So what I did was I took a SuSE 8.0 machine and basically tar'd up / so that my chroot env would have all the same libraries as any other SuSE 8 machine I have. Then I moved this tar to a debian machine, un tarred it and started the sshd deamon from inside the chroot. To seperate things further, I had the chrooted ssh run on a different port which I established in the chroots ssh configuration files. For the most part this works, here's an example of what i'm talking about

 

//assume my chroot lives in /chroot/suse80

#chroot /chroot/suse80 /etc/init.d/sshd start

 

That may seem naive, but for the most part it worked, I can ssh to the machine and things look good. I later realized that for some of the things I need to compile (not necessarily run, but compile) I needed to fake out uname so that it would report i686 instead of x86_64. I did that with a package: linux32 provided by debian

 

#linux32 chroot /chroot/suse80 /etc/init.d/sshd start

 

So again, for the most part that works. I can ssh directly into this chroot and do things as I used to on my 32bit systems that ran suse80. I.e. if I ssh things look like they did on the old system (for the most part):

 

#ssh hostname -p 2080

<hostname># uname -a

Linux node-1 2.6.17.6 #6 SMP Thu Aug 3 15:25:21 PDT 2006 i686 GNU/Linux

<hostname>#

 

 

The problem is, random (at least so far it feels random), applications run from within the chroot just kind of stop. When I say "kind of stop" it means that they look as though they are running healthily, but the reality is that they aren't. It might look similar to an application that had gotten stuck in an infinite loop or something.

 

Anyhow, I can't help but feeling with what I did that I did something wrong. Although I can happily ssh into my chroot and pretty much do things as normal, the random application failures is driving me crazy. After that I came up with some ideas that might be the cause of my problems

 

1.) Some type of problem in the kernel I'm using

2.) Issues with using linux32

3.) Issues running SuSE 8.0's sshd instead of the debian one

4.) I didn't make device nodes inside the chroot, but since nothing complain i hadn't worried about it

 

Do any of these sound reasonable to any of you? I know this was a long post, but I'm not sure where to go at this point.

 

Thanks!