FreeNAS 및 SFTP 사용자는 선택한 디렉토리로 제한됩니다.

FreeNAS 및 SFTP 사용자는 선택한 디렉토리로 제한됩니다.

SFTP(선택된) 사용자가 FreeNAS 9.10.1-U4의 홈 디렉토리로 제한하도록 하는 데 어려움이 있습니다.

기본 sshd 구성은 다음과 같습니다

Subsystem       sftp    /usr/libexec/sftp-server -l ERROR -f AUTH
Protocol 2
UseDNS no
ChallengeResponseAuthentication no
ClientAliveCountMax 3
ClientAliveInterval 15
Port 22
PermitRootLogin yes
AllowTcpForwarding no
Compression no
PasswordAuthentication yes
PubkeyAuthentication yes

그런 다음 선택한 SFTP 사용자(속해 있는 그룹을 통해)를 기본 홈 디렉터리에 잠그기 위해 아래 줄을 추가했습니다.

Match Group dirtyUsers
ChrootDirectory /mnt/Backups/tmp
ForceCommand /usr/libexec/sftp-server

dirtyUsers하지만 해당 줄을 추가한 후에 는 SFTP를 사용하여 로그인할 수 없는 사용자가 있습니다 .

SFTP 액세스에 대한 오류 로그:

Mar  2 18:42:16 backups sshd[69549]: Accepted password for dirtyUser from xxx.xxx.xxx.125 port 57495 ssh2
Mar  2 18:42:16 backups sshd[69551]: fatal: bad ownership or modes for chroot directory "/mnt/Backups/tmp"

어디

drwxr-xr-x   5 dirtyUser    dirtyUsers        5 Mar 10  2016 /mnt/Backups/tmp/

또한 아래 단계를 수행했습니다.

chown root:wheel /mnt/Backups/tmp
chmod 755 /mnt/Backups/tmp

chown dirtyUser:dirtyUsers /mnt/Backups/tmp/*
chmod 775 -R /mnt/Backups/tmp/*

하지만 로그인을 허용한 다음 SFTP에서 로그오프합니다(오류 로그 없음).

그것에 대한 조언이 있나요?

관련 정보