일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- http
- CPU
- 좌절교육
- apachetop
- 쇼펜의상속자 #킨텍스메가쇼 #섬유향수탈취제
- rsync
- PORT
- Hack
- Performance
- 솔라리스
- pid
- iptables
- cadre
- 디스크
- Bash
- rm -rf
- Linux
- goaccess
- 리눅스
- PERL
- rm
- Python
- ext3
- DNS
- Disk
- windows
- Cache
- ext4
- 칭찬교육
- Kernel
- Today
- Total
Ben's
sftp xferlog 남기기 본문
wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.3a.tar.bz2
./configure --prefix=/usr/local/proftpd --enable-openssl --enable-nls --enable-dso --with-modules=mod_tls:mod_readme:mod_ratio:mod_sftp:mod_wrap:mod_ifsession --enable-ctrls
make
make install
[proftpd.conf]
ServerName "Proftpd FTP Server For Korean"
# ServerType 은 Server 를 standalone mode 로 할것인지 inet mode로 할것 인
# 지를 정한다. default로 inetd mode로 한다. standalone mode로 할경우 아래
# MaxInstances 지시자의 주석을 해제 한다. inetd mode로 작동을 할 경우에는
# /etc/inetd.conf중에서
# ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd -l -a
# 행을 아래와 같이
# ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd
# 수정을 해 주고 Inet demon을 재 실행 해 줘야 한다.
ServerType standalone
#ServerType inetd
DefaultServer on
ServerAdmin root@localhost
DefaultChdir www
UseReverseDNS off
IdentLookups off
# Upload 이어보내기
AllowStoreRestart On
# Server 에 접속했을 경우 보내주는 Defualt 메세지를 설정한다. Off 로 지정
# 하였을 경우 Porftpd Server Ready ServerName 이 출력된다.
ServerIdent On "FTP Server ready .. "
# User login 을 했을시에 user 들이 자신의 홈상위 디렉토리들을 마음대로 돌
# 아다니지 못하게 chroot() 를 설정한다. group 별로 설정을 하게 되며 "!"는
# 제외하라는 의미를 가지게 된다.
DefaultRoot ~ !wheel
# ServerType이 standalone이면 이 항목의 주석을 풀어 줘야 한다. inetd로 작
# 동을 시킬시에는 /etc/services에서 port를 지정한다.
Port 2222
# root login 을 허락할지의 여부를 지정한다. PAM modules를 사용한다면 먼저
# /etc/proftpd/ftpusers에서 root를 삭제해야 한다.
# http://www.oops.org/SERVICE/jsboard/read.php?table=ProftpdTip&no=10 참조
RootLogin off
# pam 하고 충돌이 나는 것 같음
PersistentPasswd off
# Global section은 proftpd의 전체적인 설정에 모두 적용시킨다.
<Global>
# group 과 world writable 로 부터 새로운 dir 과 file 들을 생성하는 것을
# 막기위하여 기본적으로 umask는 022로 설정을 한다.
Umask 022
# service를 시작하고 마칠 시간을 24시간 표기법으로 지정을 한다
# UpTime 10
# DownTime 23
# Server 의 Ftpd 시간을 지역시간으로 고정한다. on 으로 했을 경우 GMT 시
# 간을 표시 하기 때문에 한국의 경우 9시간의 오차가 발생한다.
TimesGMT off
# 1.2.1 이하 버젼에서의 버그를 위한 설정
DenyFilter \*.*/
</Global>
# 회선의 Bandwidth를 특정 속도로 제한을 한다. 단위는 bps이다.
#RateReadBPS 1048576
#RateReadFreeBytes 5242880
#RateReadHardBPS on
TransferRate RETR 1048576:5242880
# 최대 접속 인원수를 지정한다.
MaxClients 100
# 하나의 호스트로 부터 동시에 접근할 수 있는 수를 지정한다. 아래의 기본
# 설정으로는 하나의 호스트에서 한번의 접근만 허용한다.
MaxClientsPerHost 4 "Sorry, %m connection allow per one host"
# 하나의 계정 ID 로 동시에 접근할 수 있는 호스트 수를 지정 한다. 아래의
# 기본 설정으로는 하나의 계정 하나 호스트에서만 접근만 허용한다. 하나의
# 계정에 하나의 접근만을 허락하려면 위의 MaxClientsPerHost의 값과
# MaxHostsPerUser의 값이 둘다 1이면 된다.
MaxHostsPerUser 4 "Sorry, %m hosts allow per one user"
# 접속 대기시간을 설정한다. user 가 접속후 아무 작동도 안할때 일정 시간후
# 에 접속이 종료되게 한다
TimeoutIdle 900
TimeoutNoTransfer 900
TimeoutLogin 300
# DeferWelcome 는 client가 인증을 하기 전에 servername을 display하는 것을
# 방지한다.
DeferWelcome off
# 'welcome.msg 는 login 시에 보여지고, 'message' 는 각 하위 디렉토리에 접
# 속 했을때 보여지게 된다.
DisplayLogin .ftpmessage
# DoS(Denial Of Service) 공격을 막기 위해, 자식 process 의 maximun number
# 를 30 으로 설정한다. 만약 30이상의 접속을 허락할 필요가 있다면 간단하게
# 이 치수를 증가 시키도록 한다. 이것은 오직 standalone mode 에서만 가능하
# 다. inetd mode 에서는 service 당 maximun number를 제한 하는 것을 허락하
# 는 inetd server에서 설정을 해야 한다.(xintd 역시 마찬가지 이다)
MaxInstances 300
User nobody
Group nobody
# 일반적으로 file들을 overwrite를 가능하게 한다.
<Directory /*>
AllowOverwrite on
</Directory>
# ls 명령어의 -a option으로 hidden file을 볼수 있게 한다.
ListOptions "-a"
<IfModule mod_sftp.c>
<VirtualHost xxx.xxx.xxx.xxx>
SFTPEngine on
SFTPLog /var/log/sftp.log
# Configure the server to listen on the normal SSH2 port, port 22
Port 2222
# Configure both the RSA and DSA host keys, using the same host key
# files that OpenSSH uses.
SFTPHostKey /etc/ssh/ssh_host_rsa_key
SFTPHostKey /etc/ssh/ssh_host_dsa_key
# Configure the file used for comparing authorized public keys of users.
SFTPAuthorizedUserKeys file:~/.sftp/authorized_keys
# Enable compression
SFTPCompression delayed
# Allow the same number of authentication attempts as OpenSSH.
#
# It is recommended that you explicitly configure MaxLoginAttempts
# for your SSH2/SFTP instance to be higher than the normal
# MaxLoginAttempts value for FTP, as there are more ways to authenticate
# using SSH2.
MaxLoginAttempts 6
AllowOverwrite on
TCPAccessFiles /etc/hosts.allow /etc/hosts.deny
</VirtualHost>
</IfModule>
* 한글 문제 있을때 : sftp 클라이언트(파일질라의 경우)는 캐릭터셋 euc-kr 로 하고 sftp서버는 export LANG=korean
* 접속시 2222로 접속해야만 sftp 로그가 남음.(22번으로 sftp 연결하면 log 남지 않음.)
http://www.castaglia.org/proftpd/modules/mod_sftp.html
'리눅스' 카테고리의 다른 글
lilo install (0) | 2013.01.21 |
---|---|
smartctl(smartmon tool) (0) | 2013.01.21 |
linux boot sequence (0) | 2013.01.21 |
strace -fFp pid (0) | 2013.01.21 |
cpulimit (0) | 2013.01.21 |