작은숲:위키노트/데비안 설정: 두 판 사이의 차이

큰숲백과, 나무를 보지 말고 큰 숲을 보라.
잔글 (문자열 찾아 바꾸기 - "분류:소프트웨어 설정" 문자열을 "분류:위키노트/소프트웨어 설정" 문자열로)
잔글 (Utolee90님이 데비안 설정 문서를 넘겨주기를 만들지 않고 작은숲:위키노트/데비안 설정 문서로 이동했습니다: 위키노트 문서 작은숲으로 이동)
 
(같은 사용자의 중간 판 3개는 보이지 않습니다)
1번째 줄: 1번째 줄:
이 문서에 있는 설정들은 [http://www.debianusers.org DebianUsers], [http://www.debian.org Debian GNU/Linux], [http://kldp.org KLDP], [http://kltp.kldp.org KLTP] 등의 문서들을 참고해서 자주 사용하는 내용들을 정리해놓은 것이다. 아래 설정들은 [[위키노트:데비안|데비안]] 시스템을 기준으로 한 것이므로, 만약 다른 리눅스 배포본을 사용하실 때는 적절히 수정해서 사용해야한다.
이 문서에 있는 설정들은 [http://www.debianusers.org DebianUsers], [http://www.debian.org Debian GNU/Linux], [http://kldp.org KLDP], [http://kltp.kldp.org KLTP] 등의 문서들을 참고해서 자주 사용하는 내용들을 정리해놓은 것이다. 아래 설정들은 [[작은숲:위키노트/데비안|데비안]] 시스템을 기준으로 한 것이므로, 만약 다른 리눅스 배포본을 사용하실 때는 적절히 수정해서 사용해야한다.
== 데비안 설정 ==
== 데비안 설정 ==
=== 방화벽 뒤에 있는 데비안 박스의 APT 설정 ===
=== 방화벽 뒤에 있는 데비안 박스의 APT 설정 ===
방화벽 뒤에서는 FTP의 passive 모드가 막혀서 <code>apt-get</code>이 제대로 동작하지 않을 수 있다. 이런 경우에는 <code>/etc/apt/apt.conf</code> 파일을 만들어 아래 내용을 넣어주면 된다.
방화벽 뒤에서는 FTP의 passive 모드가 막혀서 <code>apt-get</code>이 제대로 동작하지 않을 수 있다. 이런 경우에는 <code>/etc/apt/apt.conf</code> 파일을 만들어 아래 내용을 넣어주면 된다.
<source lang="cfg">
<syntaxhighlight lang="cfg">
# /etc/apt/apt.conf
# /etc/apt/apt.conf
Acquire
Acquire
11번째 줄: 11번째 줄:
     };
     };
};
};
</source>
</syntaxhighlight>
=== 매직키 비활성화시키기 ===
=== 매직키 비활성화시키기 ===
매직키를 활성화시켜두면, 일반 사용자도 셧다운 시킬 수가 있다. 그래서 아래와 같은 옵션을 <code>/etc/sysctl.conf</code> 파일에 설정한다.
매직키를 활성화시켜두면, 일반 사용자도 셧다운 시킬 수가 있다. 그래서 아래와 같은 옵션을 <code>/etc/sysctl.conf</code> 파일에 설정한다.
<source lang="cfg">
<syntaxhighlight lang="cfg">
# /etc/sysctl.conf
# /etc/sysctl.conf
kernel.sysrq = 0
kernel.sysrq = 0
</source>
</syntaxhighlight>
=== sysctl 설정 ===
=== sysctl 설정 ===
<code>/etc/sysctl.conf</code>에 다음을 추가한다.
<code>/etc/sysctl.conf</code>에 다음을 추가한다.
<source lang="cfg">
<syntaxhighlight lang="cfg">
net.ipv4.icmp_echo_ignore_all = 1
net.ipv4.icmp_echo_ignore_all = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
32번째 줄: 32번째 줄:
net.ipv4.conf.all.log_martians = 1
net.ipv4.conf.all.log_martians = 1
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_fin_timeout = 30
</source>
</syntaxhighlight>
=== adduser 설정 ===
=== adduser 설정 ===
<code>/etc/adduser.conf</code> 설정 변경
<code>/etc/adduser.conf</code> 설정 변경
<source lang="cfg">
<syntaxhighlight lang="cfg">
USERGROUPS=no
USERGROUPS=no
USERS_GID=500
USERS_GID=500
</source>
</syntaxhighlight>
== 데몬 설정 ==
== 데몬 설정 ==
=== [[위키노트:아파치|아파치]]에서 Teleport 류의 프로그램의 접근 막기 ===
=== [[작은숲:위키노트/아파치|아파치]]에서 Teleport 류의 프로그램의 접근 막기 ===
WebZip이나 Teleport 등의 프로그램은 홈페이지의 모든 페이지를 긁어가기에 아주 유용한 프로그램이다. 미러 페이지를 만드는 식의 일을 아주 간단하게 해주는 프로그램이다. 이런 프로그램들의 접근을 막기를 원한다면 <code>/etc/apache/srm.conf</code> (혹은 <code>/etc/apache/httpd.conf</code>) 파일에 아래 설정을 추가하면 된다.
WebZip이나 Teleport 등의 프로그램은 홈페이지의 모든 페이지를 긁어가기에 아주 유용한 프로그램이다. 미러 페이지를 만드는 식의 일을 아주 간단하게 해주는 프로그램이다. 이런 프로그램들의 접근을 막기를 원한다면 <code>/etc/apache/srm.conf</code> (혹은 <code>/etc/apache/httpd.conf</code>) 파일에 아래 설정을 추가하면 된다.
<source lang="apache">
<syntaxhighlight lang="apache">
# /etc/apache/srm.conf
# /etc/apache/srm.conf
BrowserMatch "RealPlayer 4.0" force-response-1.0
BrowserMatch "RealPlayer 4.0" force-response-1.0
52번째 줄: 52번째 줄:
BrowserMatch "WebSymmetrix" no_access
BrowserMatch "WebSymmetrix" no_access
BrowserMatch "NamoWebEditor" no_access
BrowserMatch "NamoWebEditor" no_access
</source>
</syntaxhighlight>
=== Proftpd 설정 ===
=== Proftpd 설정 ===
<code>/etc/proftpd.conf</code>에 다음 내용을 추가한다.
<code>/etc/proftpd.conf</code>에 다음 내용을 추가한다.
<source lang="cfg">
<syntaxhighlight lang="cfg">
UseReverseDNS                  off
UseReverseDNS                  off
IdentLookups                    off
IdentLookups                    off
73번째 줄: 73번째 줄:
TimeoutNoTransfer              900
TimeoutNoTransfer              900
TimeoutLogin                    300
TimeoutLogin                    300
</source>
</syntaxhighlight>
=== samba 설정 ===
=== samba 설정 ===
Samba 설정을 위해 <code>/etc/samba/smb.conf</code> 파일을 연다.
Samba 설정을 위해 <code>/etc/samba/smb.conf</code> 파일을 연다.
첫부분 <code>[global]</code> 아래에 다음을 추가한다.
첫부분 <code>[global]</code> 아래에 다음을 추가한다.
<source lang="cfg">
<syntaxhighlight lang="cfg">
hide dot files = yes   
hide dot files = yes   
veto files = /.?*/
veto files = /.?*/
</source>
</syntaxhighlight>
그리고, 아래 항목이 활성화되어 있는지 확인한다.
그리고, 아래 항목이 활성화되어 있는지 확인한다.
<source lang="cfg">
<syntaxhighlight lang="cfg">
invalid users = root
invalid users = root
</source>
</syntaxhighlight>
<code>Share Definitions</code> 항목 아래에 있는 <code>[homes]</code> 설정에 다음을 확인한다.
<code>Share Definitions</code> 항목 아래에 있는 <code>[homes]</code> 설정에 다음을 확인한다.
<source lang="cfg">
<syntaxhighlight lang="cfg">
writable = yes
writable = yes
create mask = 0644
create mask = 0644
directory mask = 0755
directory mask = 0755
</source>
</syntaxhighlight>
=== ssh 설정 ===
=== ssh 설정 ===
<code>/etc/ssh/sshd_config</code> 설정 변경
<code>/etc/ssh/sshd_config</code> 설정 변경
<source lang="cfg">
<syntaxhighlight lang="cfg">
# Change to yes to enable tunnelled clear text passwords
# Change to yes to enable tunnelled clear text passwords
#PasswordAuthentication no
#PasswordAuthentication no
PasswordAuthentication yes
PasswordAuthentication yes
</source>
</syntaxhighlight>
=== [[위키노트:Portsentry|Portysentry] 설정 ===
=== [[작은숲:위키노트/Portsentry|Portysentry] 설정 ===
<code>/etc/default/portsentry</code> 설정 변경
<code>/etc/default/portsentry</code> 설정 변경
<source lang="cfg">
<syntaxhighlight lang="cfg">
TCP_MODE="atcp"
TCP_MODE="atcp"
UDP_MODE="sudp"
UDP_MODE="sudp"
</source>
</syntaxhighlight>
=== [[위키노트:PHP|PHP]] 설정 ===
=== [[위키노트:PHP|PHP]] 설정 ===
<code>/etc/php5/apache2/php.ini</code> 설정 변경
<code>/etc/php5/apache2/php.ini</code> 설정 변경
<source lang="cfg">
<syntaxhighlight lang="cfg">
allow_url_fopen = Off
allow_url_fopen = Off
magic_quotes_gpc = On
magic_quotes_gpc = On
</source>
</syntaxhighlight>
{{리눅스}}
{{리눅스}}
[[분류:위키노트/공유]]
[[분류:위키노트/공유]]

2022년 5월 7일 (토) 19:20 기준 최신판

이 문서에 있는 설정들은 DebianUsers, Debian GNU/Linux, KLDP, KLTP 등의 문서들을 참고해서 자주 사용하는 내용들을 정리해놓은 것이다. 아래 설정들은 데비안 시스템을 기준으로 한 것이므로, 만약 다른 리눅스 배포본을 사용하실 때는 적절히 수정해서 사용해야한다.

데비안 설정

방화벽 뒤에 있는 데비안 박스의 APT 설정

방화벽 뒤에서는 FTP의 passive 모드가 막혀서 apt-get이 제대로 동작하지 않을 수 있다. 이런 경우에는 /etc/apt/apt.conf 파일을 만들어 아래 내용을 넣어주면 된다.

# /etc/apt/apt.conf
Acquire
{    ftp
    {
        Passive "false";
    };
};

매직키 비활성화시키기

매직키를 활성화시켜두면, 일반 사용자도 셧다운 시킬 수가 있다. 그래서 아래와 같은 옵션을 /etc/sysctl.conf 파일에 설정한다.

# /etc/sysctl.conf
kernel.sysrq = 0

sysctl 설정

/etc/sysctl.conf에 다음을 추가한다.

net.ipv4.icmp_echo_ignore_all = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.all.log_martians = 1
net.ipv4.tcp_fin_timeout = 30

adduser 설정

/etc/adduser.conf 설정 변경

USERGROUPS=no
USERS_GID=500

데몬 설정

아파치에서 Teleport 류의 프로그램의 접근 막기

WebZip이나 Teleport 등의 프로그램은 홈페이지의 모든 페이지를 긁어가기에 아주 유용한 프로그램이다. 미러 페이지를 만드는 식의 일을 아주 간단하게 해주는 프로그램이다. 이런 프로그램들의 접근을 막기를 원한다면 /etc/apache/srm.conf (혹은 /etc/apache/httpd.conf) 파일에 아래 설정을 추가하면 된다.

# /etc/apache/srm.conf
BrowserMatch "RealPlayer 4.0" force-response-1.0
BrowserMatch "Java/1.0" force-response-1.0
BrowserMatch "JDK/1.0" force-response-1.0
BrowserMatch "Teleport" no_access
BrowserMatch "WebZIP" no_access
BrowserMatch "WebTrack-HTTPP" no_access
BrowserMatch "WebSymmetrix" no_access
BrowserMatch "NamoWebEditor" no_access

Proftpd 설정

/etc/proftpd.conf에 다음 내용을 추가한다.

UseReverseDNS                   off
IdentLookups                    off
# Default message when one connect the server.
ServerIdent                     on      "What are you doing now? "
RootLogin                       off
# Limit bandwidth in bps
#RateReadBPS                    256
#RateReadFreeBytes              5120
#RateReadHardBPS                on
# Maximum number of clients
MaxClients                      10
# Maximum number of clients per host at the same time
MaxClientsPerHost               3
# Timeout
TimeoutIdle                     900
TimeoutNoTransfer               900
TimeoutLogin                    300

samba 설정

Samba 설정을 위해 /etc/samba/smb.conf 파일을 연다. 첫부분 [global] 아래에 다음을 추가한다.

hide dot files = yes  
veto files = /.?*/

그리고, 아래 항목이 활성화되어 있는지 확인한다.

invalid users = root

Share Definitions 항목 아래에 있는 [homes] 설정에 다음을 확인한다.

writable = yes
create mask = 0644
directory mask = 0755

ssh 설정

/etc/ssh/sshd_config 설정 변경

# Change to yes to enable tunnelled clear text passwords
#PasswordAuthentication no
PasswordAuthentication yes

[[작은숲:위키노트/Portsentry|Portysentry] 설정

/etc/default/portsentry 설정 변경

TCP_MODE="atcp"
UDP_MODE="sudp"

PHP 설정

/etc/php5/apache2/php.ini 설정 변경

allow_url_fopen = Off
magic_quotes_gpc = On
이 작은숲 문서의 출처는 위키노트의 위키노트/데비안 설정 문서입니다.