# vi /etc/ssh/sshd_config PermitRootLogin yes #Subsystem sftp /usr/libexec/openssh/sftp-server Subsystem sftp internal-sftp Match User testuser ChrootDirectory /home/engineer/test ForceCommand internal-sftp X11Forwarding no AllowTCPForwarding no # service sshd restart
chroot디렉토리 설정한 /home/engineer/test 는 755 권한
chroot와 상위디렉토리는 chown root:testuser engineer
쓰기권한이 필요하면 /home/engineer/test/하위디렉토리를 만들어서 쓰기권한폴더 생성하도록
# tail -f /var/log/secure fatal: bad ownership or modes for chroot directory "/home/engineer/test" [postauth]
오류뜨면 소유자와 755권한인지 체크해볼것
상위 디렉토리는 모두 root:engineer 755 권한