Установить прокси сервер Dante можно из репозитория Ubuntu или с сайта производителя собрать из исходников. Мы будем устанавливать из репозитория Ubuntu 18.04, так как номера версии на данный момент совпадают.
Внимание пользователей Ubuntu 16.04 и ниже!!! У вас описанным ниже способом установится очень глючная старая версия — 1.1.19!!! Вам устанавливать Dante из стандартного репозитория не надо.
Скачайте файл deb из репозитория bionic, например из Голландского зеркала:
$wget http://nl.archive.ubuntu.com/ubuntu/pool/universe/d/dante/dante-server_1.4.2+dfsg-2build1_amd64.deb
и установите последнюю версию Dante 1.4.2 ручками:
$sudo dprg -i dante-server_1.4.2+dfsg-2build1_amd64.deb
и переходите к правке конфига.
Сначала как всегда:
sudo apt update
Затем устанавливаем собственно сервер Dante:
sudo apt-get install dante-server
В первый раз сервер может не запуститься и выдать ошибки что-то типа этого:
invoke-rc.d: initscript danted, action "start" failed. ● danted.service - SOCKS (v4 and v5) proxy daemon (danted) Loaded: loaded (/lib/systemd/system/danted.service; disabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2019-01-22 13:02:35 MSK; 12ms ago Docs: man:danted(8) man:danted.conf(5) Process: 31306 ExecStart=/usr/sbin/danted -D (code=exited, status=1/FAILURE) Process: 31302 ExecStartPre=/bin/sh -c uid=`sed -n -e "s/[[:space:]]//g" -e "s/#.*//" -e "/^user\.privileged/{s/[^:]*://p;q;}" /etc/danted.conf`; if [ -n "$uid" ]; then touch /var/run/danted.pid; chown $uid /var/run/danted.pid; fi (code=exited, status=0/SUCCESS) янв 22 13:02:35 v103487.hosted-by-vdsina.ru systemd[1]: Starting SOCKS (v4 and v5) proxy daemon (danted)... янв 22 13:02:35 v103487.hosted-by-vdsina.ru danted[31306]: Jan 22 13:02:35 (1548151355.267939) danted[31306]: warning: checkconfig(): no socks authentication methods enabled. This means all socks requests will be blocked after negotiation. Perhaps this is not intended? янв 22 13:02:35 v103487.hosted-by-vdsina.ru danted[31306]: Jan 22 13:02:35 (1548151355.268481) danted[31306]: error: checkconfig(): no internal address given for server to listen for clients on янв 22 13:02:35 v103487.hosted-by-vdsina.ru danted[31306]: Jan 22 13:02:35 (1548151355.268633) danted[31306]: alert: mother[1/1]: shutting down янв 22 13:02:35 v103487.hosted-by-vdsina.ru systemd[1]: danted.service: Control process exited, code=exited status=1 янв 22 13:02:35 v103487.hosted-by-vdsina.ru systemd[1]: danted.service: Failed with result 'exit-code'. янв 22 13:02:35 v103487.hosted-by-vdsina.ru systemd[1]: Failed to start SOCKS (v4 and v5) proxy daemon (danted). Please edit the Dante server config file /etc/danted.conf and specify at least the following directives: internal external
Как и просит установка, редактируем конфиг файл:
sudo nano /etc/danted.conf
и приводим его к следующему виду:
# the server will log both via syslog, to stdout and to /var/log/sockd.log
logoutput: /var/log/sockd.log
#logoutput: stderr
# The server will bind to the address 10.1.1.1, port 1080 and will only
# accept connections going to that address.
internal: 0.0.0.0 port = ПОРТ
# Alternatively, the interface name can be used instead of the address.
#internal: eth0 port = 1080
# all outgoing connections from the server will use the IP address
# 195.168.1.1
external: Адрес_сервера
# list over acceptable authentication methods, order of preference.
# An authentication method not set here will never be selected.
#
# If the socksmethod field is not set in a rule, the global
# socksmethod is filled in for that rule.
#
# methods for socks-rules.
socksmethod: none #rfc931
# methods for client-rules.
clientmethod: none
#or if you want to allow rfc931 (ident) too
#socksmethod: username rfc931 none
#or for PAM authentication
#socksmethod: pam
#
# User identities, an important section.
#
# when doing something that can require privilege, it will use the
# userid:
user.privileged: proxy
# when running as usual, it will use the unprivileged userid of:
user.unprivileged: nobody
# If you are not using libwrap, no need for the below line, so leave
# it commented.
# If you compiled with libwrap support, what userid should it use
# when executing your libwrap commands? "libwrap".
#user.libwrap: libwrap
user.libwrap: nobody
# Allow our clients, also provides an example of the port range command.
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
# clientmethod: rfc931 # match all idented users that also are in passwordfile
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect error
}
Вместо ПОРТ подставляем выбранный вами номер порта, вместо Адрес_сервера — IP адрес вашего VDS. В такой конфигурации прокси сервер будет открытым, то-есть пользоваться им будут все, кто его найдет. Можно конечно ввести авторизацию по пользователю (см. документацию по Dante), но по умолчанию IE/Firefox/Chrome не умеют работать с SOCKS5 proxy с авторизацией. Если у вас фиксированный IP или белая сеть то можно ограничить клиентов:
client pass {
from: xx.xx.xx.xx/32 to: 0.0.0.0/0
# clientmethod: rfc931 # match all idented users that also are in passwordfile
}
Вместо xx.xx.xx.xx подставляем свой белый IP, маска 32 означает один компьютер.
Запускаем сервис Dante:
service danted start service danted enable
Настраиваем броузер на работу с proxy (SOCS5!!!) и наслаждаемся.