vsftpd 권한 설정

snowall의 이미지

윗분의 지시로 연구실 vsftpd 설정중입니다.

예를 들어, user1라는 계정이 있고 useradmins라는 계정이 있다고 하면, 요구사항이 다음과 같습니다

1. ftp접속시 모든 계정은 user1 디렉토리로 접속될 것. (공통 디렉토리 사용)
2. 업로드는 useradmins만 가능할 것.
3. 다운로드는 모든 계정에서 가능할 것.
4. 접속된 디렉토리보다 상위 디렉토리는 접근할 수 없을 것.
5. 그 외 익명 접속은 금지.

그래서 vsftpd.conf에서
listen=YES
local_enable=YES
anonymous_enable=NO
write_enable=YES
chown_uploads=YES
chown_username=user1
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
등의 옵션을 켰습니다.
그리고 지금 user1 디렉토리의 퍼미션은 rwxr-xr-x로 주어져 있습니다.
vsftpd.chroot_list 에는 user1만 들어가 있습니다.

그랬더니
1. OK
2. OK
3. useradmins만 다운로드 됨
4. useradmins는 상위 디렉토리에 접근됨
5. OK

http://www.benscobie.com/fixing-500-oops-vsftpd-refusing-to-run-with-writable-root-inside-chroot/
위의 페이지를 참고해서 allow_writeable_chroot=YES 라는 옵션을 켜면 된다는 얘기를 읽긴 했는데, 이건 vsftpd의 manpage를 아무리 살펴봐도 없는 옵션입니다.
http://linux.die.net/man/5/vsftpd.conf

vsftpd버전은 2.3.5이고 옵션 바꿀때마다 service vsftpd restart를 실행시켜주었습니다.

chroot_list에 useradmins를 넣었더니 chroot는 writable이 안된다고 하면서 연결이 안되네요.
어떤 옵션을 봐야 하나요?

snowall의 이미지

vsftpd 3.0에서는 allow_writeable_chroot가 다시 생긴다는 루머도 있지만, 잘 모르겠네요.

아무튼 다음과 같이 해결했습니다.

chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list

이건 동일하고요

passwd_chroot_enable=YES
local_root=/home/

이렇게 옵션 두개를 더 집어넣고, passwd 파일에서 /home/user1/ 로 지정되어 있는 홈 디렉토리를 /home/./user1/ 로 바꿔서 chroot가 먹도록 했습니다.

덕분에 하루가 날아갔네요...ㅋㅋ

피할 수 있을때 즐겨라! http://melotopia.net/b

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.