пятница, 30 мая 2008 г.

SSH туннель через PUTTY


Веб-серфинг
"C:\Program Files\PuTTY\plink.exe" -v -ssh -2 -P 22 -C -l USER -pw PASSWORD -L 8080:192.168.80.3:3128 192.168.80.3

где

-v : отображать подсказки
-ssh -2 : протокол и версия протокола
-P 22 : порт сервера
-l USER : имя пользователя на сервере (вместо USER)
-pw PASSWORD : пароль пользователя (вместо PASSWORD)
-L 3328:192.168.80.3:3128 - это параметры тунеля 3328 -локальный порт;192.168.80.3 - ip сервера;3128 - порт прокси на сервере.
-C : использовать сжатие


Настройка VPN через SSH с использованием Putty

Итак, имеем:

  1. компьютер на базе Windows (удаленная рабочая станция, условно КЛИЕНТ);
  2. почтовый сервер (не важно, какой именно, будь то Kerio MailServer, MDaemon или другой, условно СЕРВЕР_ПОЧТЫ в локальной сети - ну предположим, что вам надо с ним работать, а просто так локальный почтовый сервер в мир не подключен);
  3. шлюз (прокси-сервер) в интернет с запущенным сервером SSH (например, FreeBSD или Linux, которые во многих организациях стоят как брандмауэры, условно БРАНДМАУЭР).

Задача: осуществить безопасное (шифрованное) соединение от КЛИЕНТА к СЕРВЕРУ_ПОЧТЫ по протоколу POP3 (получение почты, обычно порт 110). Ну и пусть нам это надо не постоянно, а иногда (иначе надо все-таки настраивать нормальный VPN-сервер).

Решение

Т.к. по умолчанию трафик по протоколу POP3 передается открытым текстом, а мы передаем очень секретный пароль от почтового ящика, то почтовый трафик надо шифровать :) Чем мы будем его шифровать? Поднимать специальный VPN-сервер, редирект портов, настраивать сертификаты и прочее - часто не выход, т.к. это сложно даже для большинства системных администраторов, к тому же, как сказано чуть выше, нам все это надо для периодических сеансов работы, возможно, только для нас и нужных ;)

Мы будем делать соединение между КЛИЕНТОМ и СЕРВЕРОМ_ПОЧТЫ внутри шифрованного содинения по протоколу ssh.

Шаг 1.

Возьмем бесплатный клиент ssh для Windows - Putty - и установим его на КЛИЕНТА (по умолчанию, в папку "C:\Program Files\Putty").

Шаг 2.

Далее установим зашифрованное соединение между КЛИЕНТОМ и БРАНДМАУЭРОМ так, чтобы для КЛИЕНТА работа с почтой внутри локальной сети была бы точно такой, как если бы он (клиент) был бы у себя в офисе.

У КЛИЕНТА запускаем консоль: Пуск -> выполнить -> cmd

В консоли набираем команды:


cd C:\Program Files\Putty
putty.exe -v -ssh -2 -P 22 -C -l user -pw password -L 8110:192.168.1.10:110 81.222.111.10


где "-v" - т.н. verbose режим, с расширенными комментариями, "-ssh -2" - использовать протокол ssh версии 2, "-P 22" - порт, открытый на БРАНДМАУЭРЕ для подключения по ssh, "-C" - использовать сжатие, "-l user" - имя пользователя, который имеет право входить на сервер ssh на БРАНДМАУЭРЕ, "-pw password" - пароль этого пользователя,

далее (я специально сделал отступ от предыдущего текста):
"-L 8110:192.168.1.10:110" - локальный порт, который будет доступен на компьютере КЛИЕНТА, а 192.168.1.10 - локальный ip-адрес почтового сервера внутри организации, 110 - соответственно, порт POP3 на этом сервере;
"81.222.111.10" - внешний ip-адрес БРАНДМАУЭРА, к которому и будет соединяться КЛИЕНТ по ssh с помощью putty.

После набора последней команды (putty.exe -v -ssh -2 -P 22 -C -l user -pw password -L 8110:192.168.1.10:110 81.222.111.10) откроется окно сеанса связи по протоколу ssh. Все, окно сворачиваем (не закрываем!), и настраиваем нашу почтовую программу на получение почты с адреса localhost и портом 8110, а не 110, который стоит по умолчанию.

Вроде бы все. Во время получения почты почтовая программа будет соединяться с портом 8110, который будет переадресован на удаленный почтовый сервер в офисе, при этом весь трафик соединения будет зашифрован. Завершить сеанс связи можно просто закрыв окно сеанса putty. После этого локальный порт 8110 уже не будет доступен.

Можно добавить, что похожим образом можно соединяться не только к почтовому серверу, но и к другим сервисам, например, я таким образом соединялся с RAdmin, установленным на компьютере в локальной сети, при этом никаких port-мапперов на самом шлюзе делать не надо. Вот что самое хорошее! Достаточно иметь актуальную версию сервера ssh на шлюзе и, желательно, фильтровать на брандмауэре подключения к порту 22 (ssh), например по ip-адресу, если у вас дома или где там еще подключение к интернет постоянное. Но это уже мелочи жизни и тема другой статьи.

Вообще у ssh и putty, есть ооочень много всяких разных приятностей, которые здесь не упомянуты. Надеюсь, эта статья подтолкнет вас к небольшому исседованию, начать которое очень просто: http://www.google.ru/search?complete=1&hl=ru&newwindow=1&q=ssh&lr=&aq=f.

Кроме того, упомянутые в статье программы (за исключением почтовых серверов и ОС самого клиента ;)) являются бесплатными и свободно распространяемыми, а стремление быть легальным и бесплатным - хороший стимул приглядеться к реализации подобного безопасного соединения через ssh.

И еще, конечно же, при написании этой заметки я использовал другие ресурсы для "освежения" памяти. Вот самая полезная ссылка, которая и стала финальной в моих тестовых экспериментах перед опубликованием статьи: http://wiki.kaytaz.ru/doku.php/ssh-tunnel_cherez_putty.

Примечания (составлены по итогам комментариев на 27.03.2008)

1. (isx) Если туннель простаивает некоторое время, то соединение рвется, потому стоит поменять параметры сервера: TCPKeepAlive. Увеличить LoginGraceTime, выставить ClientAliveInterval и ClientAliveCountMax. Убрать UseDns, иначе длительные ожидания при установке соединений.

2. (isx) А отчего не сделаешь все через ssl? Если не хочется возиться с почтовиком, то можно воспользоваться программой stunnel, поднимая ее на шлюзе(брандмауэре). // Stunnel (http://stunnel.mirt.net/) использует OpenSSl или SSLeavy для шифрования трафика. Используется для установления шифрованных тонелей связи между клиентом и сервером. Работает в Linux, Windows, OS/2 и прочих осях.

3. (Serg) Если человек не админ брендмауэра - могут быть проблемы. Кто-то может гарантировать, что в настройках sshd не выключен форвардинг и/или туннелирование? // Действительно, к данному решению надо подходить взвешенно и понимать, что указанный способ туннелирования действительно больше всего подходить только для админа.

Создание туннеля через Putty и ssh.

В unix системе:

ssh -L666:адрес_прокси_или_сервера:порт -n имяпользователя@адрес_ssh_сервера

В windows:

Для конфигурации туннеля с помощью PuTTY нужно в окне конфигурации подключения в категории Session указать Host Name: ваш_ssh_сервер, Port: 22, Protocol: SSH и в категории Connection/SSH/Tunnels в секции Add new forwarded port указать Source port: локальный_порт (например, 666), Destination: адрес_прокси_или_сервера:3306, выбрать пункт Local и нажать кнопку добавить. После установления соединения можно запускать интернет браузер например, указав в качестве прокси 127.0.0.1 и порт, указанный в качестве Source Port (например, 666). Вот так.

четверг, 29 мая 2008 г.

Linux: Установка даты и времени

Знаете ли вы, что по умолчанию в Linux каждые сутки примерно в четыре часа ночи запускаются различные служебные задачи?! Например очистка временных каталогов, сжатие лог-файлов и т.п. А теперь представьте, что время на сервере настроено неправильно и все эти задачи запускаются в час пик посещаемости вашего сайта.

Правильно установленные дата и время необходимы для корректной работы планировщика задач. Кроме того, они пишутся во все основные системные лог-файлы и лог-файлы посещений веб-сервера.

Наберите команду date, чтобы посмотреть текущие дату и время. Если необходимо изменить их, воспользуйтесь следующим форматом команды:

date MMDDhhmmCCYY.ss

MM — месяц, DD — день месяца, hh — часы, mm — минуты, CCYY — 4 цифры года, ss — секунды
Например:

date 100615352006.30

Эта команда установит текущие дату и время на 06 октября 2006 года, 15:35:30.

Обратите внимание: дату и время может изменять только root-пользователь.

воскресенье, 18 мая 2008 г.

Установка Ubuntu к имеющейся Windows XP

Установка Ubuntu к имеющейся Windows XP (для зарегистрированных на torrents.ru)

Easy Firewall Generator for IPTables

Генератор скрипта IPTABLES

UBUNTU server

UBUNTU сервер БЛОГ

файл ifcfg-eth0

ifcfg-eth0 (RedHAT)

# Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.0.255
HWADDR=00:1B:FC:6A:C1:5C
IPADDR=192.168.0.13
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes


INTERFACES (UBUNTU, DEBIAN)

auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

SAMBA


---------------------
SMB.CONF


[global]
workgroup = work
netbios name = linux
server string = linux Samba File-server
log file = /var/log/samba/log.%m
max log size = 50
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192
local master = yes
preferred master = yes
domain master = no
interfaces = eth0 192.168.0.20 127.0.0.1
hosts deny = ALL
hosts allow = 192.168.0. 127.0.0.1
dns proxy = no
name resolve order = lmhosts host bcast
dos charset = cp1251
os level = 20
unix charset = utf8
bind interfaces only = yes
guest ok = no
deadtime = 15
username map = /etc/samba/smbusers
veto files = /*.db/
level2 oplocks = True
hide dot files = yes
--------------------------------------
[common]
comment = common documents
path = /home/doc
writeable = yes
valid users = @office
force group = office
create mask = 0660
directory mask = 0771
---------------------------------------
;[РЇСЂРєРѕР’]
; comment = РЇСЂРєРѕР’Рќ
; path = /home/yarkovn/doc
; writeable = yes
; valid users = yarkovn root
; create mask = 0664
; directory mask = 0775
---------------------------------------
[сисадмин]
comment = сисадмин
path = /home/sysadmin/doc
writeable = yes
valid users = arayakao root
create mask = 0664
directory mask = 0775
--------------------------------------
;[Лейко]
; comment = ЛейкоЛЛ
; path = /home/leiko/doc
; writeable = yes
; valid users = leiko root
; create mask = 0664
; directory mask = 0775
-----------------------------------
;[Балюк]
; comment = БалюкСЕ
; path = /home/balyuk/doc
; writeable = yes
; valid users = balyuk root
; create mask = 0664
; directory mask = 0775
------------------------------------
;[Лозовой]
; comment = Лозовой
; path = /home/lozovoy/doc
; writeable = yes
; valid users = Lozovoy root
; create mask = 0664
; directory mask = 0775
--------------------------------------
;[Савченко]
; comment = Савченко
; path = /home/savchenko/doc
; writeable = yes
; valid users = savchenko root
; create mask = 0664
; directory mask = 0775
-----------------------------------------
;[Польшина]
; comment = Польшина
; path = /home/polshina/doc
; writeable = yes
; valid users = polshina root
; create mask = 0664
; directory mask = 0775
-----------------------------------------
;[Краснонос]
; comment = Краснонос
; path = /home/krasnonos/doc
; writeable = yes
; valid users = krasnonos root
; create mask = 0664
; directory mask = 0775
------------------------------------------
;[Франчук]
; comment = Франчук
; path = /home/franchuk/doc
; writeable = yes
; valid users = franchuk root
; create mask = 0664
; directory mask = 0775
-------------------------------------
[INSTALL]
comment = Programm Files
path = /media/install
writeable = yes
valid users = root Lozovoy Andrey
create mask = 0664
directory mask = 0775
---------------------------------------
[PHOTO_YARKO.A.N.]
comment = не отсортированые фото Ярко А.Н.
path = /pub/1/video
writeable = yes
valid users = root Goloschapova
create mask = 0664
directory mask = 0775
----------------------------------------
[MUSIC]
comment = MUSIC Files
path = /pub/1/music
writeable = yes
valid users = @office
create mask = 0664
directory mask = 0775
--------------------------------------------
[Фотоархив]
comment = Фотоархив
path = /pub/photo
writeable = yes
valid users = @office
create mask = 0664
directory mask = 0775
-------------------------------------------
;[stroyinform]
; comment = Stroy Inform DataBase
; path = /home/stroyinf
; writeable = yes
; valid user = @office
; create mask = 0777
; directory mask = 0777
----------------------------------------
[homes]
comment = Home Directories
browseable = no
valid users = %U
writeable = yes
create mask = 0700
directory mask = 0700


APACHE



HTTPD.CONF



#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See for detailed information.
# In particular, see
#
# for a discussion of each configuration directive.
#
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# The configuration directives are grouped into three basic sections:
# 1. Directives that control the operation of the Apache server process as a
# whole (the 'global environment').
# 2. Directives that define the parameters of the 'main' or 'default' server,
# which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# of all virtual hosts.
# 3. Settings for virtual hosts, which allow Web requests to be sent to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "/etc/httpd" will be interpreted by the
# server as "/etc/httpd/logs/foo.log".
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# Don't give away too much information about all the subcomponents
# we are running. Comment out this line if you don't mind remote sites
# finding out what major optional modules you are running
ServerTokens OS

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation
# (available at );
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "/etc/httpd"

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile run/httpd.pid

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 120

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive Off

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

##
## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves

StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 256
MaxClients 256
MaxRequestsPerChild 4000


# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves

StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0


#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 192.168.0.13:80

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule info_module modules/mod_info.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule cgi_module modules/mod_cgi.so

#
# The following modules are not loaded by default:
#
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule asis_module modules/mod_asis.so

#
# Load config files from the config directory "/etc/httpd/conf.d".
#
Include conf.d/*.conf

#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
#ExtendedStatus On

#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# . On SCO (ODT 3) use "User nouser" and "Group nogroup".
# . On HPUX you may not be able to use shared memory as nobody, and the
# suggested workaround is to create a user www and use that user.
# NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
# when the value of (unsigned)Group is above 60000;
# don't use Group #-1 on these systems!
#
User apache
Group apache

### Section 2: 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# definition. These values also provide defaults for
# any containers you may define later in the file.
#
# All of these directives may appear inside containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
ServerAdmin root@localhost

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work. See also the UseCanonicalName directive.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
#ServerName www.example.com:80
ServerName fedora.linux.ua2
#
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client. When set "On", Apache will use the value of the
# ServerName directive.
#
UseCanonicalName Off

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#

Options FollowSymLinks
AllowOverride None


#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#


#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all



#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid. This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
# See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden
#

#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
UserDir disable

#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
#UserDir public_html



#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
#
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#
# Order allow,deny
# Allow from all
#

#
# Order deny,allow
# Deny from all
#

#


#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.html index.html.var
#DirectoryIndex index.html.var

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#

Order allow,deny
Deny from all


#
# TypesConfig describes where the mime.types file (or equivalent) is
# to be found.
#
TypesConfig /etc/mime.types

#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type. The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#

# MIMEMagicFile /usr/share/magic.mime
MIMEMagicFile conf/magic


#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

#
# EnableMMAP: Control whether memory-mapping is used to deliver
# files (assuming that the underlying OS supports it).
# The default is on; turn this off if you serve from NFS-mounted
# filesystems. On some systems, turning it off (regardless of
# filesystem) can improve performance; for details, please see
# http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap
#
#EnableMMAP off

#
# EnableSendfile: Control whether the sendfile kernel support is
# used to deliver files (assuming that the OS supports it).
# The default is on; turn this off if you serve from NFS-mounted
# filesystems. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile
#
#EnableSendfile off

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error_log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# "combinedio" includes actual counts of actual bytes received (%I) and sent (%O); this
# requires the mod_logio module to be loaded.
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a
# container, they will be logged here. Contrariwise, if you *do*
# define per- access logfiles, transactions will be
# logged therein and *not* in this file.
#
#CustomLog logs/access_log common

#
# If you would like to have separate agent and referer logfiles, uncomment
# the following directives.
#
#CustomLog logs/referer_log referer
#CustomLog logs/agent_log agent

#
# For a single logfile with access, agent, and referer information
# (Combined Logfile Format), use the following directive:
#
CustomLog logs/access_log combined

#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of: On | Off | EMail
#
ServerSignature On

#
# Aliases: Add here as many aliases as you need (with no limit). The format is
# Alias fakename realname
#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL. So "/icons" isn't aliased in this
# example, only "/icons/". If the fakename is slash-terminated, then the
# realname must also be slash terminated, and if the fakename omits the
# trailing slash, the realname must also omit it.
#
# We include the /icons/ alias for FancyIndexed directory listings. If you
# do not use FancyIndexing, you may comment this out.
#
Alias /icons/ "/var/www/icons/"


Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all


#
# WebDAV module configuration section.
#

# Location of the WebDAV lock database.
DAVLockDB /var/lib/dav/lockdb


#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#

AllowOverride None
Options None
Order allow,deny
Allow from all


#
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Example:
# Redirect permanent /foo http://www.example.com/bar

#
# Directives controlling the display of server-generated directory listings.
#

#
# IndexOptions: Controls the appearance of server-generated directory
# listings.
#
IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable

#
# AddIcon* directives tell the server which icon to show for different
# files or filename extensions. These are only displayed for
# FancyIndexed directories.
#
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

#
# DefaultIcon is which icon to show for files which do not have an icon
# explicitly set.
#
DefaultIcon /icons/unknown.gif

#
# AddDescription allows you to place a short description after a file in
# server-generated indexes. These are only displayed for FancyIndexed
# directories.
# Format: AddDescription "description" filename
#
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz

#
# ReadmeName is the name of the README file the server will look for by
# default, and append to directory listings.
#
# HeaderName is the name of a file which should be prepended to
# directory indexes.
ReadmeName README.html
HeaderName HEADER.html

#
# IndexIgnore is a set of filenames which directory indexing should ignore
# and not include in the listing. Shell-style wildcarding is permitted.
#
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

#
# DefaultLanguage and AddLanguage allows you to specify the language of
# a document. You can then use content negotiation to give a browser a
# file in a language the user can understand.
#
# Specify a default language. This means that all data
# going out without a specific language tag (see below) will
# be marked with this one. You probably do NOT want to set
# this unless you are sure it is correct for all cases.
#
# * It is generally better to not mark a page as
# * being a certain language than marking it with the wrong
# * language!
#
# DefaultLanguage nl
#
# Note 1: The suffix does not have to be the same as the language
# keyword --- those with documents in Polish (whose net-standard
# language code is pl) may wish to use "AddLanguage pl .po" to
# avoid the ambiguity with the common suffix for perl scripts.
#
# Note 2: The example entries below illustrate that in some cases
# the two character 'Language' abbreviation is not identical to
# the two character 'Country' code for its country,
# E.g. 'Danmark/dk' versus 'Danish/da'.
#
# Note 3: In the case of 'ltz' we violate the RFC by using a three char
# specifier. There is 'work in progress' to fix this and get
# the reference data for rfc1766 cleaned up.
#
# Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
# English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)
# Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
# Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
# Norwegian (no) - Polish (pl) - Portugese (pt)
# Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
# Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW)
#
AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw

#
# LanguagePriority allows you to give precedence to some languages
# in case of a tie during content negotiation.
#
# Just list the languages in decreasing order of preference. We have
# more or less alphabetized them here. You probably want to change this.
#
LanguagePriority ru en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR sv zh-CN zh-TW

#
# ForceLanguagePriority allows you to serve a result page rather than
# MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
# [in case no accepted languages matched the available variants]
#
ForceLanguagePriority Prefer Fallback

#
# Specify a default charset for all content served; this enables
# interpretation of all content as UTF-8 by default. To use the
# default browser choice (ISO-8859-1), or to allow the META tags
# in HTML content to override this choice, comment out this
# directive:
#
AddDefaultCharset cp1251
#AddDefaultCharset UTF-8

#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
#AddType application/x-tar .tgz
AddType application/x-httpd-php3 .phtml

#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have nothing
# to do with the FancyIndexing customization directives above.
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz

# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi

#
# For files that include their own HTTP headers:
#
#AddHandler send-as-is asis

#
# For type maps (negotiated resources):
# (This is enabled by default to allow the Apache "It Worked" page
# to be distributed in multiple languages.)
#
AddHandler type-map var

#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# Putting this all together, we can internationalize error responses.
#
# We use Alias to redirect any /error/HTTP_.html.var response to
# our collection of by-error message multi-language collections. We use
# includes to substitute the appropriate text.
#
# You can modify the messages' appearance without changing any of the
# default HTTP_.html.var files by adding the line:
#
# Alias /error/include/ "/your/include/path/"
#
# which allows you to create your own set of files by starting with the
# /var/www/error/include/ files and
# copying them to /your/include/path/, even on a per-VirtualHost basis.
#

Alias /error/ "/var/www/error/"




AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Order allow,deny
Allow from all
LanguagePriority en es de fr
ForceLanguagePriority Prefer Fallback


# ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
# ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
# ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
# ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
# ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
# ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
# ErrorDocument 410 /error/HTTP_GONE.html.var
# ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
# ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
# ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
# ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
# ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
# ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
# ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
# ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
# ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
# ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var




#
# The following directives modify normal HTTP response behavior to
# handle known problems with browser implementations.
#
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

#
# The following directive disables redirects on non-GET requests for
# a directory that does not include the trailing slash. This fixes a
# problem with Microsoft WebFolders which does not appropriately handle
# redirects for folders with DAV methods.
# Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
#
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully

#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".example.com" to match your domain to enable.
#
#
# SetHandler server-status
# Order deny,allow
# Deny from all
# Allow from .example.com
#


#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
#
# SetHandler server-info
# Order deny,allow
# Deny from all
# Allow from .example.com
#


#
# Proxy Server directives. Uncomment the following lines to
# enable the proxy server:
#
#
#ProxyRequests On
#
#
# Order deny,allow
# Deny from all
# Allow from .example.com
#


#
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
#
#ProxyVia On

#
# To enable a cache of proxied content, uncomment the following lines.
# See http://httpd.apache.org/docs/2.2/mod/mod_cache.html for more details.
#
#
# CacheEnable disk /
# CacheRoot "/var/cache/mod_proxy"
#

#

#

# End of proxy directives.

### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
#
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
#NameVirtualHost *:80
NameVirtualHost 192.168.0.13
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#


ServerAdmin root@FEDORA.linux.ua2
DocumentRoot /var/www/html/alt
ServerName alt.linux.ua2

allow from all
Options +Indexes

ErrorLog logs/alt.com-error_log
CustomLog logs/alt.com-access_log common


ServerAdmin root@FEDORA.linux.ua2
DocumentRoot /var/www/html/deb
ServerName deb.linux.ua2

allow from all
Options +Indexes

ErrorLog logs/deb.com-error_log
CustomLog logs/deb.com-access_log common


ServerAdmin root@FEDORA.linux.ua2
DocumentRoot /var/www/html/torkret
ServerName torkret.linux.ua2

allow from all
Options +Indexes

ErrorLog logs/torkret.com-error_log
CustomLog logs/torkret.com-access_log common


ServerAdmin root@FEDORA.linux.ua2
DocumentRoot /var/www/html/intuit
ServerName intuit.linux.ua2

allow from all
Options +Indexes

ErrorLog logs/intuit.com-error_log
CustomLog logs/intuit.com-access_log common


ServerAdmin root@FEDORA.linux.ua2
DocumentRoot /home/arayakao/public_html
ServerName my-site.linux.ua2

allow from all
Options +Indexes

ErrorLog logs/my-site.com-error_log
CustomLog logs/my-site.com-access_log common


ServerAdmin root@FEDORA.linux.ua2
DocumentRoot /home/arayakao/public_html1
ServerName joomla.linux.ua2

allow from all
Options +Indexes

ErrorLog logs/joomla.com-error_log
CustomLog logs/joomla.com-access_log common


DNS сервер BIND

NAMED.CONF

//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//

options {
listen-on port 53 { 127.0.0.1; 192.168.0.13; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { 192.168.0.0/24; };
recursion no;
};

logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

zone "localhost" IN {
type master;
file "localhost.zone";
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "127.0.0.zone";
};

zone "." IN {
type hint;
file "named.ca";
};

zone "linux.ua2" {
type master ;
file "alp.db" ;

};

zone "0.168.192.in-addr.arpa" {
type master ;
file "192.168.0.rev" ;
};



//include "/etc/named.rfc1912.zones";


ALP.DB


$TTL 3H
@ IN SOA fedora.linux.ua2. root.fedora.linux.ua2. (
20080359
10800
3600
360000
86400 )
IN NS fedora.linux.ua2.
IN A 192.168.0.13
fedora IN A 192.168.0.13

crocus IN A 192.168.0.15



deb IN A 192.168.0.13
alt IN A 192.168.0.13
torkret IN A 192.168.0.13
intuit IN A 192.168.0.13
my-site IN A 192.168.0.13
joomla IN A 192.168.0.13


192.168.0.rev


$TTL 3H
@ IN SOA fedora.linux.ua2. root.fedora.linux.ua2. (
200803203
10800
3600
3600000
86400 )

@ IN NS fedora.linux.ua2.

13 IN PTR fedora.linux.ua2.

15 IN PTR crocus.linux.ua2.


13 IN PTR deb.linux.ua2.
13 IN PTR alt.linux.ua2.
13 IN PTR torkret.linux.ua2.
13 IN PTR intuit.linux.ua2.
13 IN PTR my-site.linux.ua2.
13 IN PTR joomla.linux.ua2.

PPTPD сервер на FEDORA 8

pptpd.conf

###############################################################################
# $Id: pptpd.conf,v 1.10 2006/09/04 23:30:57 quozl Exp $
#
# Sample Poptop configuration file /etc/pptpd.conf
#
# Changes are effective when pptpd is restarted.
###############################################################################

# TAG: ppp
# Path to the pppd program, default '/usr/sbin/pppd' on Linux
#
#ppp /usr/sbin/pppd

# TAG: option
# Specifies the location of the PPP options file.
# By default PPP looks in '/etc/ppp/options'
#
option /etc/ppp/options.pptpd

# TAG: debug
# Turns on (more) debugging to syslog
#
#debug

# TAG: stimeout
# Specifies timeout (in seconds) on starting ctrl connection
#
# stimeout 10

# TAG: noipparam
# Suppress the passing of the client's IP address to PPP, which is
# done by default otherwise.
#
#noipparam

# TAG: logwtmp
# Use wtmp(5) to record client connections and disconnections.
#
logwtmp

# TAG: bcrelay
# Turns on broadcast relay to clients from interface
#
#bcrelay eth1

# TAG: delegate
# Delegates the allocation of client IP addresses to pppd.
#
# Without this option, which is the default, pptpd manages the list of
# IP addresses for clients and passes the next free address to pppd.
# With this option, pptpd does not pass an address, and so pppd may use
# radius or chap-secrets to allocate an address.
#
#delegate

# TAG: connections
# Limits the number of client connections that may be accepted.
#
# If pptpd is allocating IP addresses (e.g. delegate is not
# used) then the number of connections is also limited by the
# remoteip option. The default is 100.
#connections 100

# TAG: localip
# TAG: remoteip
# Specifies the local and remote IP address ranges.
#
# These options are ignored if delegate option is set.
#
# Any addresses work as long as the local machine takes care of the
# routing. But if you want to use MS-Windows networking, you should
# use IP addresses out of the LAN address space and use the proxyarp
# option in the pppd options file, or run bcrelay.
#
# You can specify single IP addresses seperated by commas or you can
# specify ranges, or both. For example:
#
# 192.168.0.234,192.168.0.245-249,192.168.0.254
#
# IMPORTANT RESTRICTIONS:
#
# 1. No spaces are permitted between commas or within addresses.
#
# 2. If you give more IP addresses than the value of connections,
# it will start at the beginning of the list and go until it
# gets connections IPs. Others will be ignored.
#
# 3. No shortcuts in ranges! ie. 234-8 does not mean 234 to 238,
# you must type 234-238 if you mean this.
#
# 4. If you give a single localIP, that's ok - all local IPs will
# be set to the given one. You MUST still give at least one remote
# IP for each simultaneous client.
#
# (Recommended)
localip 192.168.0.150-160
remoteip 192.168.0.170-180
# or
#localip 192.168.0.234-238,192.168.0.245
#remoteip 192.168.1.234-238,192.168.1.245
localip 192.168.0.150-160
remoteip 192.168.0.170-180
listen 192.168.0.13

options.pptpd

###############################################################################
# $Id: options.pptpd,v 1.11 2005/12/29 01:21:09 quozl Exp $
#
# Sample Poptop PPP options file /etc/ppp/options.pptpd
# Options used by PPP when a connection arrives from a client.
# This file is pointed to by /etc/pptpd.conf option keyword.
# Changes are effective on the next connection. See "man pppd".
#
# You are expected to change this file to suit your system. As
# packaged, it requires PPP 2.4.2 and the kernel MPPE module.
###############################################################################


# Authentication

# Name of the local system for authentication purposes
# (must match the second field in /etc/ppp/chap-secrets entries)
name pptpd

# Strip the domain prefix from the username before authentication.
# (applies if you use pppd with chapms-strip-domain patch)
#chapms-strip-domain


# Encryption
# (There have been multiple versions of PPP with encryption support,
# choose with of the following sections you will use.)


# BSD licensed ppp-2.4.2 upstream with MPPE only, kernel module ppp_mppe.o
# {{{
refuse-pap
refuse-chap
refuse-mschap
# Require the peer to authenticate itself using MS-CHAPv2 [Microsoft
# Challenge Handshake Authentication Protocol, Version 2] authentication.
require-mschap-v2
# Require MPPE 128-bit encryption
# (note that MPPE requires the use of MSCHAP-V2 during authentication)
require-mppe-128
# }}}


# OpenSSL licensed ppp-2.4.1 fork with MPPE only, kernel module mppe.o
# {{{
#-chap
#-chapms
# Require the peer to authenticate itself using MS-CHAPv2 [Microsoft
# Challenge Handshake Authentication Protocol, Version 2] authentication.
#+chapms-v2
# Require MPPE encryption
# (note that MPPE requires the use of MSCHAP-V2 during authentication)
#mppe-40 # enable either 40-bit or 128-bit, not both
#mppe-128
#mppe-stateless
# }}}


# Network and Routing

# If pppd is acting as a server for Microsoft Windows clients, this
# option allows pppd to supply one or two DNS (Domain Name Server)
# addresses to the clients. The first instance of this option
# specifies the primary DNS address; the second instance (if given)
# specifies the secondary DNS address.
#ms-dns 10.0.0.1
#ms-dns 10.0.0.2

# If pppd is acting as a server for Microsoft Windows or "Samba"
# clients, this option allows pppd to supply one or two WINS (Windows
# Internet Name Services) server addresses to the clients. The first
# instance of this option specifies the primary WINS address; the
# second instance (if given) specifies the secondary WINS address.
#ms-wins 10.0.0.3
#ms-wins 10.0.0.4

# Add an entry to this system's ARP [Address Resolution Protocol]
# table with the IP address of the peer and the Ethernet address of this
# system. This will have the effect of making the peer appear to other
# systems to be on the local ethernet.
# (you do not need this if your PPTP server is responsible for routing
# packets to the clients -- James Cameron)
proxyarp

# Normally pptpd passes the IP address to pppd, but if pptpd has been
# given the delegate option in pptpd.conf or the --delegate command line
# option, then pppd will use chap-secrets or radius to allocate the
# client IP address. The default local IP address used at the server
# end is often the same as the address of the server. To override this,
# specify the local IP address here.
# (you must not use this unless you have used the delegate option)
#10.8.0.100


# Logging

# Enable connection debugging facilities.
# (see your syslog configuration for where pppd sends to)
#debug

# Print out all the option values which have been set.
# (often requested by mailing list to verify options)
#dump


# Miscellaneous

# Create a UUCP-style lock file for the pseudo-tty to ensure exclusive
# access.
lock

# Disable BSD-Compress compression
nobsdcomp

# Disable Van Jacobson compression
# (needed on some networks with Windows 9x/ME/XP clients, see posting to
# poptop-server on 14th April 2005 by Pawel Pokrywka and followups,
# http://marc.theaimsgroup.com/?t=111343175400006&r=1&w=2 )
novj
novjccomp

# turn off logging to stderr, since this may be redirected to pptpd,
# which may trigger a loopback
nologfd

# put plugins here
# (putting them higher up may cause them to sent messages to the pty)


chap-secrets

# Secrets for authentication using CHAP
# client server secret IP addresses
login * password *

Настройка vsftpd с авторизацией и без

vsftpd.conf с авторизацией

listen=YES
#listen_address=172.16.23.125
#listen_port=20456
#anonymous_enable=YES
#anon_upload_enable=YES
#anon_mkdir_write_enable=YES
#anon_other_write_enable=YES
local_enable=YES
write_enable=YES
dirmessage_enable=YES
#connect_from_port_20=YES
chown_uploads=YES
chown_username=arayakao
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
idle_session_timeout=300
data_connection_timeout=50
#nopriv_user=nobody
#ascii_upload_enable=NO
#ascii_download_enable=NO
ftpd_banner=Welcome to FTP-server
#convert_charset_enable=YES
#local_charset=UTF8
#remote_charset=WIN1251
#user_config_dir=/etc/vsftpd/vusers
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
userlist_file=/etc/vsftpd/user_list
userlist_deny=NO
file_open_mode=0777
#check_shell=NO
#deny_email_enable=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
local_max_rate=10240000
trans_chunk_size=0
max_per_ip=5
max_clients=5
#local_root=/web
#pasv_min_port=40000
#pasv_max_port=65535
local_umask=022

vsftpd.conf без авторизации

anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=077
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
xferlog_file=/var/log/vsftpd/ftp.log
listen=YES
anon_max_rate=100000000
local_max_rate=100000000
max_clients=20
max_per_ip=10
anon_root=/media/ftp
listen_port=21
pam_service_name=vsftpd
tcp_wrappers=YES
local_enable=0
one_process_model=1
anon_umask=0000
#ascii_upload_enable=NO
#ascii_download_enable=NO
#convert_charset_enable=YES
#remote_charset=WIN1251
#local_charset=UTF8



user_list

# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
arayakao
#yakirill

В этом файле записываются пользователи которым разрешён доступ к ФТП.

В файле chroot_list записываются пользователи, которые могут выходит из чрутинга