Vsftpd – 500 oops chroot() Error 해결


우분투 12.04 의 vsftpd 2.3.5 에서 발생하던 문제다.

하지만 14.04 에서도 똑같이 발생한다.

설정파일 /etc/vsftpd.conf 에서 “chroot_local_user=YES” 와 같이 chroot를 적용하면 사용자의 ftp디렉토리에 쓰기권한이 부여되어 있으면 발생한다. 당연히 FTP 사용자는 파일의 업로드가 가능해야 할텐데 보안의 헛점이 발견되어 이를 막는 과정에서 발생한 것으로 보인다.

자신만 사용할 FTP 라면 chroot 기능을 비활성하고 사용해도 되지만 다른 사용자들과 함께 사용할 FTP라면 chroot 기능을 활성화해야 한다.

예전 버전이라면 3가지 방법이 있다.

[dropshadowbox align=”none” effect=”lifted-both” width=”100%” height=”” background_color=”#ffffff” border_width=”1″ border_color=”#dddddd” ]

1. Define option local_root= in configuration file. must by /home or other path to directory with users folders. In this way vsftpd chrooting to /home directory.

local_root=/home 으로 지정해서 다른 사용자들이 /home 밖으로 나가지 못하게 하는 것.
허나 이방식은 /home 디렉토리 이하에 존재하게 될 다른 사용자들의 홈디렉토리등이 모두 보이게 된다.
이를 퍼미션을 이용하여 어떻게든 안보이게 할 수 있을듯 하나 복잡한 건 나도 싫다…

2. Define option passwd_chroot_enable=yes in configuration file and change in /etc/passwd file user home directory from «/home/user» to «/home/./user» (w/o quotes).
In this way vsftpd chrooting to /home directory.

이 방식은 사용자들의 홈디렉토리를 수정하는 방식으로 /etc/passwd 에 사용자의 홈디렉토리 부분을 /home/./user 와 같이 .를 추가하는 방식인데 이 방식도 1번 방식과 같이 /home 디렉토리 이하의 모든 디렉토리를 리스팅한다.

3. Download sources of vsftpd-ext, compile and overwrite exist vsftpd binaries or take it from repositories and add to configuration file option allow_writable_root=yes.

vsftpd-ext 를 설치하고 설정파일에 allow_writable_root=yes 를 삽입하여 해결한다.

[/dropshadowbox]

 

근데 최신 버전을 사용하고 있다면 아래와 같이 하면 된다

[dropshadowbox align=”none” effect=”lifted-both” width=”100%” height=”” background_color=”#ffffff” border_width=”1″ border_color=”#dddddd” ]

$ sudo vi /etc/vsftpd.conf

allow_writeable_chroot=YES <-추가

$ sudo restart vsftpd

[/dropshadowbox]


답글 남기기

이메일 주소는 공개되지 않습니다.