35638
Goto Top

OpenSSH - ChrootDirectory

ChrootDirectory Befehl in der sshd_config führt zu Fehlern

Hallo Community,

Ich habe auf meiner kleinen NAS (IcyBox 4210) mit optware ein openssh 5.2p1-2 laufen. Ich wollte nun einstellen, dass ich Gästen auf diesem Gerät erlauben kann per SFTP ein Verzeichniss zu beschreiben. SFTP funktioniert auch wunderbar, jedoch wollte ich das ganze mittels chroot auf ein Verzeichniss beschränken, also habe ich folgende Konfiguration in sshd_config vorgenommen:
Match group sftponly
       ChrootDirectory %h
       ForceCommand internal-sftp
(wird die ChrootDirectory Zeile auskommentiert klappt der SFTP Zugriff wunderbar)

Versuche ich jetzt mit WinSCP mich per SFTP auf dem Gerät zu verbinden bekomme ich folgende Meldung: Cannot initialize SFTP protocol. Is the host running a SFTP server?
Die Log sagt:
. 2009-10-03 00:43:45.014 Sent password
. 2009-10-03 00:43:45.034 Access granted
. 2009-10-03 00:43:45.034 Opened channel for session
. 2009-10-03 00:43:45.044 Started a shell/command
. 2009-10-03 00:43:45.044 --------------------------------------------------------------------------
. 2009-10-03 00:43:45.044 Using SFTP protocol.
. 2009-10-03 00:43:45.044 Doing startup conversation with host.
> 2009-10-03 00:43:45.054 Type: SSH_FXP_INIT, Size: 5, Number: -1
. 2009-10-03 00:43:45.054 Server sent command exit status 255
. 2009-10-03 00:43:45.054 Disconnected: All channels closed
* 2009-10-03 00:43:45.064 (ESshFatal) Connection has been unexpectedly closed. Server sent command exit status 255.
* 2009-10-03 00:43:45.064 Cannot initialize SFTP protocol. Is the host running a SFTP server?

Auf dem Server sagt syslog dazu:
Oct  3 00:43:49 nashira sshd[5584]: error: Could not get shadow information for inetguest
Oct  3 00:43:50 nashira sshd[5585]: fatal: bad ownership or modes for chroot directory component "/mnt/ide1/inetguest/"  

Das Homeverzechnis des Users, mit dem ich mich einloggen möchte, gehört root und hat volle Berechtigung für alle.

Hat hier jemand erfahrung mit dem Thema? Muss ich noch etwas besonderes beachten?

Bedanke mich schonmal für eure Hilfe

Gruß

Content-Key: 126346

Url: https://administrator.de/contentid/126346

Printed on: April 16, 2024 at 22:04 o'clock