로그인
Sign in
only ftp 유저만 사용해서 자신의 홈디렉토리 외에 다른 디렉토리로 접근할 수 없고
ftp만 사용하게끔 하는 방법과  

telnet 유저가 자신의 디렉토리외에 다른 디렉토리로 접근이 불가하고
지정해준 명령어 외에는 사용 못하게 하는 방식입니다.



아래 내용 참조하세요.



< ftp user 제한 생성 및 설정 >

1. ftpaccess file을 설정합니다.

a. cd /etc/ftpd

b. cp -p /usr/newconfig/etc/ftpd/ftpaccess .

c. vi ftpaccess

"guestgroup ftponly" 항목을 이미 존재하는 group으로 변경하거나
그대로 두고 groupadd 명령을 이용하여 ftponly라는 group을 생성한다.
#/etc/group file에 ftponly라는 group을 생성하시면 됩니다. #




# @(#)B.11.11_LR
#
loginfails 2

class   local   real,guest,anonymous *.domain 0.0.0.0
class   remote  real,guest,anonymous *

limit   local   20  Any                 /etc/msgs/msg.toomany
limit   remote  100 SaSu|Any1800-0600   /etc/msgs/msg.toomany
limit   remote  60  Any                 /etc/msgs/msg.toomany

readme  README*    login
readme  README*    cwd=*

message /welcome.msg            login
message .message                cwd=*

compress        yes             local remote
tar             yes             local remote

# allow use of private file for SITE GROUP and SITE GPASS?
private         yes

# passwd-check  <none|trivial|rfc822>  [<enforce|warn>]
passwd-check    rfc822  warn

log commands real
log transfers anonymous,real inbound,outbound
shutdown /etc/shutmsg

# all the following default to "yes" for everybody
delete          no      anonymous         # delete permission?
overwrite       no      anonymous         # overwrite permission?
rename                  no              guest,anonymous # rename permission?
chmod           no      anonymous               # chmod permission?
umask           no      anonymous               # umask permission?

delete          yes      guest         # delete permission?      #### 권한 줌
overwrite       yes      guest         # overwrite permission?   #### 권한 줌

# specify the upload directory information
upload  /var/ftp  *             no
upload  /var/ftp  /incoming     yes     root    daemon  0600 dirs
upload  /var/ftp  /bin          no
upload  /var/ftp  /etc          no

# directory aliases
alias   inc    /incoming

# cdpath
cdpath  /incoming
cdpath  /pub
cdpath  /

# path-filter...
path-filter  anonymous  /etc/pathmsg  ^[-A-Za-z0-9_\.]*$  ^\.  ^-
path-filter  guest      /etc/pathmsg  ^[-A-Za-z0-9_\.]*$  ^\.  ^-

# specify which group of users will be treated as "guests".
guestgroup ftponly
guestuser sktnmc

email user@hostname

-----------------------------------------------------------------------------

/etc/ftpd/ftpaccess 파일에
delete          no      guest,anonymous         # delete permission?
overwrite       no      guest,anonymous         # overwrite permission?
이 설정 시...  guest와 anonymous 계정은 삭제나 덮어쓸 수 없다.

권한 적용시

delete          no      anonymous         # delete permission?
overwrite       no      anonymous         # overwrite permission?

delete          yes      guest         # delete permission?    
overwrite       yes      guest         # overwrite permission?  

anonymous 계정은 삭제를 하지 못하는데.. guest user는 삭제와 덮어쓰기를 할 수 있다.


%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*%&*



2. /etc/inetd.conf file을 수정합니다.

        a. vi /etc/inetd.conf

        b. ftp daemon에 -a option을 추가합니다.

        c. ftp      stream tcp nowait root /usr/lbin/ftpd      ftpd -a -l



3. inetd daemon이 config file을 다시 읽도록 합니다.

inetd -c



4. 가짜 shell을 만들어 해당 user에게 ftp만 가능하도록 설정합니다.

        a. vi /usr/bin/ftpshell

        b. exit 0 을 입력한 후 빠져 나옵니다.

        c. chmod 555 /usr/bin/ftpshell

        d. chown bin:bin /usr/bin/ftpshell



5. /etc/shells file을 만듭니다.

        a. vi /etc/shells

        b. file에 아래의 line들을 추가합니다.

/sbin/sh

/usr/bin/ksh

/usr/bin/sh

/usr/bin/csh

/usr/bin/rsh

/usr/bin/rksh

/usr/bin/keysh

/bin/sh

/bin/ksh

/bin/csh

/bin/rsh

/bin/rksh

/usr/bin/ftpshell


6. system에 user를 등록합니다.

        a. useradd 명령을 이용하여 user를 생성.
        이 때 'ftponly'로 지정한 group을 사용하여야 하며
        login shell은 /usr/bin/ftpshell을 설정하십시오.



7. home directory에 chroot를 설정하기 위해 passwd 파일의 home directory부분을
아래와 같이 설정합니다.

/home/username/./



8. ls 명령을 제공하기 위해서 아래와 같이 실행합니다.

        a. cd /home/username

        b. mkdir usr

        c. mkdir usr/bin

        d. cp -p /sbin/ls usr/bin

        e. chown -R bin:bin usr

        f. chmod -R 555 usr



< 제한된 login user 생성 >


1.       useradd 나 sam으로 user 생성

2.       vi /etc/passwd로 user의 사용 쉘 부분을 /usr/bin/rsh로 변경

3.       mkdir /usr/rbin

아래와 같이 원하는 명령어를 복사합니다.(ex: ls,vi,clear)

        cp /usr/bin/ls /usr/rbin
        cp /usr/bin/vi /usr/rbin
        cp /usr/bin/clear /usr/rbin


4. vi .profile의 맨 마지막에, 한줄 추가합니다.

        export PATH=/usr/rbin

로그인하는 rsh유저는, 다른 모든 명령어를 사용할 수 없고
ls,vi,clear명령어만 사용가능해집니다.

추가해주고 싶은 명령어는 /usr/rbin/밑에 복사만 해주면 됩니다
조회 수 :
2464
추천 수 :
17 / 0
등록일 :
2005.11.10
09:10:00 (*.236.3.225)
엮인글 :
http://bestceok.com/xe/index.php?mid=unix_com&document_srl=2705&act=trackback&key=37c
게시글 주소 :
http://bestceok.com/xe/index.php?mid=unix_com&document_srl=2705
List of Articles
번호 제목 글쓴이 날짜 조회 수
공지 자주 사용하는 명령어 제비게릴라 2019-06-27 179
52 /etc/lvmtab의 내용과 ioscan의 Disk Path 바뀔 때 수정 방법 하록 2006-07-20 916
51 APM 설치 옵션 하록 2006-07-05 594
50 CDE에서 로그인시 자동으로 프로그램 시작하는 방법 하록 2006-06-21 671
49 System Error시에 볼 파일... 하록 2006-04-12 948
48 glance 옵션... 하록 2006-03-22 933
47 대랑 접속 시도 Process 검색.... 하록 2006-03-22 536
46 Logtool Tutorial: Summary 하록 2006-02-21 604
45 Unix Health Check 하록 2006-02-21 853
44 Mirrored된 Disk를 분리하는 방법 하록 2006-02-21 580
43 시스템 crash 분석 방법 하록 2006-02-21 936
42 Fast Ethernet Duplex 설정 하록 2006-02-03 1011
» ftp, telnet 사용시 권한을 제한 하는 방법 하록 2005-11-10 2464
40 EMC에 연동된 Path 찾는 방법 하록 2005-11-03 1927
39 Linux Lan BandWidth 확인 방법 하록 2005-09-21 893
38 history파일에 사용된 command에 시간을 넣는 방법 하록 2005-08-16 533
37 q4 이용 덤프 분석 하록 2005-08-16 656
36 Install시 terminal type 하록 2005-08-16 1812
35 Disk Striping 하록 2005-08-16 665
34 커널 재구성 방법(SCSI DAT 추가시) 하록 2005-08-16 517
33 HW path 정리 하록 2005-08-16 506