|
커피향이 나는 *NIX
커피닉스
시스템/네트웍/보안을 다루는 곳
|
|
|
|
| 이전 주제 보기 :: 다음 주제 보기 |
| 글쓴이 |
메시지 |
포비 손님
|
올려짐: 2004.2.06 금, 4:53 pm 주제: [질문] vsftp의 루트 디렉토리.. |
|
|
vsftp 를 사용중이며, 하고자 하는것은
/data/ftp/up
/data/ftp/down
요 두개의 디렉토리만 특정 유저한테 보여주는겁니다.
anonymous 금지와, ftp 접속시 자신의 계정이 아닌 /data/ftp 로 들어가서
up, down 두개의 폴더만 달랑 보이게 하는거죠....
그런데 몇가지는 대충 해냈습니다.
그런데, 사용자가 접속을 하면,
..
down
up
이렇게 보이면서 저위의 점두개때문에 상위 디렉토리로 접근이 가능하더군요..
자신의 /home/id <---여기가 아닌
임의의/data/ftp/ 위의 디렉토리 위쪽으로 못가게 가려면 어떻게 해야 하나요?
===============================================
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are very paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
#
# 2004 02 07 jeongil change root directory
# Allow anonymous FTP?
anonymous_enable=NO
#
#change root directory
local_root=/data/ftp
# local user add jeongil 2004 02 07
chroot_local_user=YES
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
ascii_upload_enable=YES
ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to Winters FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES |
|
| 위로 |
|
 |
yasu 손님
|
|
| 위로 |
|
 |
truefeel 카페 관리자
가입: 2003년 7월 24일 올린 글: 1277 위치: 대한민국
|
올려짐: 2004.2.07 토, 11:44 pm 주제: Re: [질문] vsftp의 루트 디렉토리.. |
|
|
vsftpd는 아쉽지만 proftpd의 DefaultRoot설정처럼 경로를 임의로 지정하는 설정은 없습니다.
위의 링크에 있는 방법으로 사용자의 홈디렉토리를 변경하는 방법도 있겠지만 mount로 비슷하게 구현할 수 있습니다.
abcd 사용자가 있다고 할 때 FTP 접속시 abcd 홈(/home/abcd/)으로 들어가는 것으로 가정하겠습니다.
우선 root 권한으로 다음 /data/ftp/ 이하의 디렉토리를 마운트(binding)합니다.
| 코드: |
# cd /home/abcd
# mkdir up
# mkdir down
# mount --bind /data/ftp/up up
# mount --bind /data/ftp/up down
|
mount 명령을 내리면 어떻게 mount되는지 확인할 수 있을 것입니다.
vsftpd.conf 에서 chroot_local_user=YES 을 했을 경우
홈디렉토리 상위로는 갈 수는 없지만 /data/ftp/up, down 디렉토리만은 접근이 가능하게 될 것입니다.
이 외에 virtual user 설정으로도 비슷하게 할 수 있으며
이 부분은 vsftpd 소스의 EXAMPLE/VIRTUAL_USERS, VIRTUAL_USERS_2 에 설정 예가 있습니다. |
|
| 위로 |
|
 |
|
|
새로운 주제를 올릴 수 없습니다 답글을 올릴 수 없습니다 주제를 수정할 수 있습니다 올린 글을 삭제할 수 없습니다 투표를 할 수 없습니다
|
Powered by phpBB © 2001, 2005 phpBB Group
|