El Sábado, 24 de Junio de 2006 19:26, Iñaki escribió: > No es la primera vez que me peleo con rssh para permitir a un > usuario "rssh_user" acceder sólo por sftp o scp a mi ordenador y tenerle > enjaulado en su home.
Me acabo de dar cuenta de que ni siquiera puedo hacer un chroot en el direectorio /home/jaula, y eso que por si fuese necesario he copiado también /bin/bash y sus dependencias (extraidas de ldd) al directorio jaula. Es decir: #> chroot /home/jaula ---------------------------------------------------------------------------------------- chroot: cannot run command `/bin/bash': No such file or directory ---------------------------------------------------------------------------------------- En la web de RSSH: http://www.pizzashack.org/rssh/faq.shtml#6 he encontrado lo siguiente: ---------------------------------------------------------------------------------------- Q: When I connect to an account configured to use a chroot jail, I just get a "Connection closed" message. Why? A: The problem is that you have not set up your chroot jail properly... Something is missing. As I've said numerous times throughout the documentation, setting up a chroot jail is very system dependent, so if you've read the CHROOT file carefully and followed the directions there carefully, and it still doesn't work, then I almost certainly can't help you. But then, if you had done all that, you wouldn't need to be looking here... Note that if you are using rssh with Solaris 9, FreeBSD, AIX 5.2, or probably other operating systems, you will need to copy your system shell into the chroot jail, because wordexp() uses it to expand command-line arguments on those platforms. See the CHROOT file for more details. There is a script called mkchroot.sh included with the source and the RPM packages. For most Linux users this should do the job, though it may need some small modifications for paths of some files. However it seems that on recent Linux distros, the script is missing something important, and I haven't yet figured out what that is... If you are able to identify it, please post to the mailing list to let me (and everyone else) know. If you run into this problem, and can't figure out what is missing, I've found that copying all of /lib into the jail seems to fix it. Not an ideal solution, but it works. ---------------------------------------------------------------------------------------- Tras leer el último párrafo he probao lo que dice, es decir, he copiado todo /lib (27MB) en /home/jaula/lib y ahora resulta que sí que puedo hacer chroot (que es precisamente lo que comenta el tipo de arriba): #> chroot /home/jaula ---------------------------------------------------------------------------------------- bash-3.00# ... ---------------------------------------------------------------------------------------- Claro, la gracia sería saber qué librería(s) es exactamente la que faltaba para no hacer la chapuza de tener que copiarlas todas. Pero aun así no me funciona el tema de entrar por SFTP con el usuario rssh_user. Me sale exactamente lo mismo que al princiipio (comentado los logs y todo en el correo inicial). En fin, que ya decía que no es la primera vez que lo intento y siempre me quedo por aquí. Saludos. -- Por el bien de todos respetemos las normas de la lista: http://wiki.debian.org/NormasLista