[opensuse-es] Problema con chroot
Hola a tod@s: He seguido las instrucciones de éste sitio: http://www.cyberciti.biz/tips/howto-linux-unix-rssh-chroot-jail-setup.html Pero tengo un grave problema: cuando el usuario accede mediante sftp y ejecuta el comando: cd / ... accede a la raíz del sistema principal, no a la raíz del sistema enjaulado. A continuación, mi archivo rssh.conf: # This is the default rssh config file # set the log facility. "LOG_USER" and "user" are equivalent. logfacility = LOG_USER # Leave these all commented out to make the default action for rssh to lock # users out completely... allowscp allowsftp #allowcvs #allowrdist #allowrsync # set the default umask umask = 022 # If you want to chroot users, use this to set the directory where the root of # the chroot jail will be located. # # if you DO NOT want to chroot users, LEAVE THIS COMMENTED OUT. chrootpath=/opt/jailusers # You can quote anywhere, but quotes not required unless the path contains a # space... as in this example. #chrootpath = "/usr/local/my chroot" user=usuario1:077:00011: user=usuario2:022:00011: ########################################## # EXAMPLES of configuring per-user options #user=rudy:077:00010: # the path can simply be left out to not chroot #user=rudy:077:00010 # the ending colon is optional #user=rudy:011:00100: # cvs, with no chroot #user=rudy:011:01000: # rdist, with no chroot #user=rudy:011:10000: # rsync, with no chroot #user="rudy:011:00001:/usr/local/chroot" # whole user string can be quoted #user=rudy:01"1:00001:/usr/local/chroot" # or somewhere in the middle, freak! #user=rudy:'011:00001:/usr/local/chroot' # single quotes too # if your chroot_path contains spaces, it must be quoted... # In the following examples, the chroot_path is "/usr/local/my chroot" #user=rudy:011:00001:"/usr/local/my chroot" # scp with chroot #user=rudy:011:00010:"/usr/local/my chroot" # sftp with chroot #user=rudy:011:00011:"/usr/local/my chroot" # both with chroot # Spaces before or after the '=' are fine, but spaces in chrootpath need # quotes. #user = "rudy:011:00001:/usr/local/my chroot" #user = "rudy:011:00001:/usr/local/my chroot" # neither do comments at line end ¿Alguien sabe cómo puedo solucionar éste problema? Cordialmente, Cuervo Linuxero -- No recibo/envío información elaborados en/para M$-Word, M$-Excel, M$-PowerPoint, M$-Outlook o formatos privativos similares. Le invito a leer mis razones: http://www.gnu.org/philosophy/no-word-attachments.es.html -- Para dar de baja la suscripción, mande un mensaje a: opensuse-es+unsubscribe@opensuse.org Para obtener el resto de direcciones-comando, mande un mensaje a: opensuse-es+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Content-ID:
He seguido las instrucciones de éste sitio:
http://www.cyberciti.biz/tips/howto-linux-unix-rssh-chroot-jail-setup.html
Pero tengo un grave problema: cuando el usuario accede mediante sftp y ejecuta el comando: cd / ... accede a la raíz del sistema principal, no a la raíz del sistema enjaulado.
A continuación, mi archivo rssh.conf:
La configuración del servidor ftp no tiene nada que ver con la del ssh. Aunque en este caso se trate de sftp, no estoy seguro que sea tan distinto. Por ejemplo, el man dice que si lo que intentas es sólo hacer ftp, no sesiones interactivas, no tienes que copiar nada en el arbol: The ChrootDirectory must contain the necessary files and directories to support the users' session. For an interactive session this requires at least a shell, typically sh(1), and basic /dev nodes such as null(4), zero(4), stdin(4), stdout(4), stderr(4), arandom(4) and tty(4) devices. For file transfer sessions using “sftftp no additional configuration of the environment is necessary if the in-process sftp server is used (see Subsystem for details). De hecho, se considera un peligro tener que copiar los binarios de las cosas que se ejecuten para usarlos en el ftp, debe ser el propio servidor ftp el que proporcione todos los comandos necesarios interna y nativamente. - -- Saludos Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAku/vnIACgkQtTMYHG2NR9XaJACeLInqMBrgmJ9h4G55EVmHzJLq KvkAoJmFs6mOBuwcYrJtKAk5gDEBjHCK =iO0b -----END PGP SIGNATURE-----
El Fri, 09 Apr 2010 18:04:38 -0500, RŌNIN escribió:
Hola a tod@s:
He seguido las instrucciones de éste sitio:
http://www.cyberciti.biz/tips/howto-linux-unix-rssh-chroot-jail- setup.html
Pero tengo un grave problema: cuando el usuario accede mediante sftp y ejecuta el comando: cd / ... accede a la raíz del sistema principal, no a la raíz del sistema enjaulado.
Se supone que con ssh los puedes enjaular, revisa este hilo del foro: *** ssh/sftp 5.3 chroot http://forums.opensuse.org/get-help-here/network-internet/428230-ssh-sftp-5-... *** Saludos, -- Camaleón -- Para dar de baja la suscripción, mande un mensaje a: opensuse-es+unsubscribe@opensuse.org Para obtener el resto de direcciones-comando, mande un mensaje a: opensuse-es+help@opensuse.org
Hola a tod@s: El día 10 de abril de 2010 04:57, Camaleón escribió:
Se supone que con ssh los puedes enjaular, revisa este hilo del foro:
*** ssh/sftp 5.3 chroot http://forums.opensuse.org/get-help-here/network-internet/428230-ssh-sftp-5-... ***
Siguiendo el ejemplo encontrado en el enlace que me enviaste, agregué ésto al archivo /et -- No recibo/envío información elaborados en/para M$-Word, M$-Excel, M$-PowerPoint, M$-Outlook o formatos privativos similares. Le invito a leer mis razones: http://www.gnu.org/philosophy/no-word-attachments.es.html -- Para dar de baja la suscripción, mande un mensaje a: opensuse-es+unsubscribe@opensuse.org Para obtener el resto de direcciones-comando, mande un mensaje a: opensuse-es+help@opensuse.org
Hola a tod@s:
El día 10 de abril de 2010 04:57, Camaleón
Se supone que con ssh los puedes enjaular, revisa este hilo del foro:
*** ssh/sftp 5.3 chroot http://forums.opensuse.org/get-help-here/network-internet/428230-ssh-sftp-5-... ***
Hola a tod@s: El día 10 de abril de 2010 04:57, Camaleón escribió:
Se supone que con ssh los puedes enjaular, revisa este hilo del foro:
*** ssh/sftp 5.3 chroot http://forums.opensuse.org/get-help-here/network-internet/428230-ssh-sftp-5-... ***
Siguiendo el ejemplo encontrado en el enlace que me enviaste, agregué ésto al archivo /etc/ssh/sshd_config de mi sistema: Match User usuario1,usuario2 ChrootDirectory %h X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp Match Pero al reiniciar el servicio ssh, me aparece lo siguiente: [root@test ssh]# /etc/init.d/sshd restart Stoping sshd: [ OK ] Starting sshd: /etc/ssh/sshd_config: line 90: Bad configuration option: Match /etc/ssh/sshd_config: line 94: Bad configuration option: ForceCommand /etc/ssh/sshd_config: line 95: Bad configuration option: Match /etc/ssh/sshd_config: terminating, 3 bad configuration options [ FAIL ] ¿Qué estoy haciendo mal? Quedo atento a sus comnetarios/indicaciones/sugerencias. Cordialmente, Cuervo Linuxero P. D. Disculpen si llegó un mensaje incompleto, tal vez pulsé accidentalmente la tecla equivocada. -- No recibo/envío información elaborados en/para M$-Word, M$-Excel, M$-PowerPoint, M$-Outlook o formatos privativos similares. Le invito a leer mis razones: http://www.gnu.org/philosophy/no-word-attachments.es.html -- Para dar de baja la suscripción, mande un mensaje a: opensuse-es+unsubscribe@opensuse.org Para obtener el resto de direcciones-comando, mande un mensaje a: opensuse-es+help@opensuse.org
El Mon, 12 Apr 2010 12:00:38 -0500, RŌNIN escribió:
El día 10 de abril de 2010 04:57, Camaleón escribió:
Se supone que con ssh los puedes enjaular, revisa este hilo del foro:
*** ssh/sftp 5.3 chroot http://forums.opensuse.org/get-help-here/network-internet/428230-ssh- sftp-5-3-chroot.html#post2086011 ***
Siguiendo el ejemplo encontrado en el enlace que me enviaste, agregué ésto al archivo /etc/ssh/sshd_config de mi sistema:
Match User usuario1,usuario2 ChrootDirectory %h X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp Match
Pero al reiniciar el servicio ssh, me aparece lo siguiente:
[root@test ssh]# /etc/init.d/sshd restart Stoping sshd: [ OK ] Starting sshd: /etc/ssh/sshd_config: line 90: Bad configuration option: Match /etc/ssh/sshd_config: line 94: Bad configuration option: ForceCommand /etc/ssh/sshd_config: line 95: Bad configuration option: Match /etc/ssh/sshd_config: terminating, 3 bad configuration options [ FAIL ]
¿Qué estoy haciendo mal?
Te dice que no reconoce esos valores. Las instrucciones del foro eran para el SSH 5.1 en openSUSE 11.1 ¿qué versión tienes instalada de SSH (ssh -V) y de openSUSE (cat /etc/... hum... ostras, que no me acuerdo de cómo era. Pues tiro de Google: cat / etc/SuSE-release). Saludos, -- Camaleón -- Para dar de baja la suscripción, mande un mensaje a: opensuse-es+unsubscribe@opensuse.org Para obtener el resto de direcciones-comando, mande un mensaje a: opensuse-es+help@opensuse.org
participants (3)
-
Camaleón
-
Carlos E. R.
-
RŌNIN