출처 :  http://www.google.com/url?sa=t&source=web&cd=2&ved=0CCkQFjAB&url=http%3A%2F%2Fwww-01.ibm.com%2Fsupport%2Fdocview.wss%3Fuid%3Dkts1dc85068f29c2486449256d35001e6ae1%26aid%3D1&rct=j&q=ftpaccess.ctl&ei=G7d6TpnZCNGSiQflnrQL&usg=AFQjCNFpDM9yAn2jiMvP32MqKtfFPTmSrg&cad=rja



AIX5L 5.2의 ftpd는 ftp 로그인 전후에 메시지를 표시하는 기능, 특정 호스트들의 접속 제한 기능, 사용자의 디렉토리별
읽기/쓰기 권한 설정 기능, 그리고 제한된 anonymous 사용자 로그인 기능을 지원한다.


이러한 기능들을 설정하기 위해 /etc/ftpaccess.ctl 파일을 생성/편집하여야 하며, 이 파일이 없을 경우에는 일반 ftpd와
동일하게 동작한다.


위의 구성파일 키워드는 아래와 같이
notification, host restrictions, directory restrictions, restricted users 의 4가지 그룹으로 나누어진다.

# Notification
herald: filename
motd: on|off
# Host restrictions
allow: hostname, hostname, ...
deny: hostname, hostname, ...
# Directory restrictions
readonly:dirname, dirname, ... | ALL | NONE
writeonly: dirname, dirname, ... | ALL | NONE
readwrite: dirname, dirname, ... | ALL | NONE
# Restricted users
useronly: username, username, ...
grouponly: groupname, groupname, ...




Notification 그룹 키워드 중에서 herald는 로그인 전에 표시할 메시지를 정의하며,메시지를 담고 있는 파일의 경로명으로
설정한다. Motd 키워드는 로그인 후에 motd를 표시할 경우에는 on, 아닐 경우에는 off로
설정한다. 
단, on으로 설정한 경우에는 해당 사용자의 홈 디렉토리에 motd 파일이 존재해야 한다.


아래는 notification 그룹 키워드 사용 예이다.


# cat /etc/ftpaccess.ctl
herald: /etc/ftpherald.txt
motd: on
# cat /etc/ftpherald.txt
Welcome to our FTP Server
#cat /motd
This is roots’s MOTD
# ftp
ftp.mycompany.example
Connected to ftp.mycompany.example.
220-
220-Welcome to our FTP Server
220-
220
ftp.mycompany.example FTP server (Version 4.1 Mon Aug 19 21:52:59 CDT 2002) ready.
Name (
ftp.mycompany.example:root):
331 Password required for root.
Password:
230-Last unsuccessful login: Sun Sep 8 01:32:26 CDT 2002 on /dev/pts/4 from
sig-9-65-80-212.mts.ibm.com
230-Last login: Sun Sep 8 23:35:25 CDT 2002 on /dev/pts/4 from here.mycompany.example
230-
230- This is roots’s MOTD
230-
230 User root logged in.
ftp> quit




Host restrictions 키워드인 allow와 deny는 접속이 허용된 호스트들을 지정할 수 있게 한다.
Allow 키워드를 설정한
경우에는, 그 외의 모든 호스트들의 접속이 거부되며, deny 키워드를 설정한 경우에는
그 외의 모든 호스트들의 접속이
허용된다.

아래는 allow 키워드의 사용 예이다.

# Comments - Allow these specific hostname and addresses
# All other hosts are denied.
allow: myhost1.mycompany.example, myhost3.mycompany.example
allow: myhost4.mycompany.example, myhost9.mycompany.example
allow: 192.168.1.50



다음은 deny 키워드의 사용 예이다.

# Comments - Allow all hosts to connect except for the bad ones
deny: badhost1.othercompany.example, badhost2.othercompany.example


단, allow와 deny 키워드는 서로 배타적이므로 함께 사용할 수 없다.



Directory restrictions 키워드인 readonly, writeonly, 그리고 readwrite는 FTP 접속 사용자들이 어느 디렉토리에
어떤 읽기/쓰기 권한을 가지는지 설정한다. 단, anonymous ftp가 아닌 일반 ftp 접속자들에게만
적용된다.

Readonly 키워드는 FTP 접속 사용자들이 해당 디렉토리에 대한 쓰기(Put) 권한을 막으며, writeonly 키워드는 읽기 권한을
막는다. Readwrite 키워드는 FTP 사용자들이 지정된 특정 디렉토리에서만 읽기/쓰기가 가능하도록
제한한다.
단, writeonly 키워드를 설정하더라도 해당 디렉토리의 내용을 ls 명령으로 검사하는 것은 허용하며,
그러한 권한도 막으려면
OS에서 그 디렉토리 자체의 읽기 권한을 해제해야 한다.


Readonly와 writeonly 키워드의 효과는 readwrite 키워드가 설정되었는지의 여부에 따라 다르다. Readwrite 키워드가
설정되지 않은 경우에는, 특별히 readonly와 writeonly 키워드 설정되지 않은 모든
디렉토리에 대해 FTP 사용자들의
읽기 및 쓰기 권한을 가진다.


Readwrite 키워드가 설정된 경우에는, readwrite 및 readonly가 설정된 디렉토리에 대해서만 읽기 권한을 가지며, readwrite
및 writeonly가 설정된 디렉토리에 대해서만 쓰기 권한을 가진다. 또한, 그 이외의 모든
디렉토리에 대해서는 읽기 및 쓰기가
허용되지 않는다.



아래는 ftpaccess.ctl 파일의 구성 예를 나타낸 것이다.

# setup a dropoff directory where users can write (put) files
# but are unable to read (get) them.
writeonly: /home/dist/incoming
# setup a software distribution directory where users can
# only read(get) from /home/dist/pub only. No other access is
# permitted
readonly: /home/dist/pub
readwrite: NONE

# setup a software distribution directory where users can
# only read(get) from /home/dist/pub only. No other access is
# permitted
readonly: /home/dist/pub
readwrite: NONE




Restricted user 키워드인 useronly와 grouponly는 자신의 홈 디렉토리만 접근이 가능한 제한적 anonymous ftp 사용자들을
지정한다. 이 때, 이 사용자들의 홈 디렉토리는 전통적인 anonymous ftp
사용자 디렉토리와 유사한 구조를 가져야하는데,
/usr/samples/tcpip/anon.users.ftp 예제 스크립트를
사용하여 필요한 계정과 디렉토리 구조를 쉽게 생성할 수 있다.


아래는 ftp3라는 제한된 ftp 사용자를 생성하는 예이다.


# /usr/samples/tcpip/anon.users.ftp ftp3
Creating ftp3 as an anonymous ftp user.
Added user ftp3.
Are you sure you want to modify /home/ftp3?
y
Made /home/ftp3/bin directory.
Made /home/ftp3/etc directory.
Made /home/ftp3/pub directory.
Made /home/ftp3/lib directory.
Made /home/ftp3/dev/null entry.
Made /home/ftp3/usr/lpp/msg/en_US directory.




 

'::: OS ::: > AIX' 카테고리의 다른 글

AIX 의 DNS 검색 순서 변경 방법  (0) 2012.05.11
AIX 설치시 기본 확인 사항  (0) 2011.10.24
lsmksysb  (0) 2011.09.22
fuser 명령어  (0) 2011.09.20
Fast Paths for SMIT Tasks  (0) 2011.09.15

+ Recent posts