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/밑에 복사만 해주면 됩니다
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/밑에 복사만 해주면 됩니다