Configuración
de un servidor DNS primario y Secundario en Debian:
INSTALACIÓN
apt-get update
apt-get install bind9 ssh
CONEXIÓN REMOTA
ssh root@192.168.0.17
ssh root@192.168.0.18
PRIMARIO
CONFIGURACIÖN DE LA RED
$
/etc/udev/rules.d/70-persistent-net.rules
$
/etc/resolv.conf
$ps
-aux|grep name
$netstat
-putan
nano /etc/network/interfaces
# This file describes the network
interfaces available on your system
# and how to
activate them. For more information, see interfaces(5).
# The loopback
network interface
auto lo
iface lo inet
loopback
# The primary
network interface
allow-hotplug eth0
iface eth0 inet
dhcp
auto eth1
iface eth1 inet
static
address
10.0.0.2
netmask
255.255.255.0
/etc/resolv.conf
nameserver 127.0.0.1
CONFIGURACION DE ZONAS
nano /etc/bind/named.conf.local
//DIRECTAS
zone
"iespoligonosur.org" {
type
master;
file
"/etc/bind/db.iespoligonosur.org";
};
zone
"1asir.iespoligonosur.org" {
type
master;
file
"/etc/bind/db.iespoligonosur.1asir.org";
};
zone
"2asir.iespoligonosur.org" {
type
master;
file
"/etc/bind/db.iespoligonosur.2asir.org";
};
//INVERSAS
zone
"0.0.10.in-addr.arpa" {
type
master;
file
"/etc/bind/db.10.0.0";
};
zone
"127.168.192.in-addr.arpa" {
type
master;
file
"/etc/bind/db.192.168.127";
};
zone
"128.168.192.in-addr.arpa" {
type
master;
file
"/etc/bind/db.192.168.128";
};
CONFIGURACIÓN DE REGISTOS DIRECTOS
nano /etc/bind/db.iespoligonosur.org
iespoligonosur.org.
IN SOA ns1.iespoligonosur.org.
admin.iespoligonosur.org. (
2 ;Serial
60480 ;Refresh
86400 ;Retry
2419200 ;Expire
60480 ) ;Negative Cache TTL
;
iespoligonosur.org.
IN NS ns1.iespoligonosur.org.
iespoligonosur.org.
IN NS ns2.iespoligonosur.org.
ns1.iespoligonosur.org.
IN A 10.0.0.2
ns2.iespoligonosur.org.
IN A 10.0.0.3
ftp.iespoligonosur.org.
IN A 10.0.0.4
nano
/etc/bind/db.iespoligonosur.1asir.org
1asir.iespoligonosur.org.
IN SOA ns1.iespoligonosur.org.
admin.iespoligonosur.org. (
2 ;Serial
60480 ;Refresh
86400 ;Retry
2419200 ;Expire
60480 ) ;Negative Cache TTL
;
1asir.iespoligonosur.org.
IN NS ns1.iespoligonosur.org.
1asir.iespoligonosur.org.
IN NS ns2.iespoligonosur.org.
pc01.1asir.iespoligonosur.org.
IN A 192.168.127.11
nano
/etc/bind/db.iespoligonosur.2asir.org
2asir.iespoligonosur.org. IN
SOA ns1.iespoligonosur.org. admin.iespoligonosur.org. (
2 ;Serial
60480
;Refresh
86400
;Retry
2419200 ;Expire
60480)
;Negative Cache TTL
;
2asir.iespoligonosur.org.
IN NS ns1.iespoligonosur.org.
2asir.iespoligonosur.org.
IN NS ns2.iespoligonosur.org.
pc01.2asir.iespoligonosur.org.
IN A 192.168.128.11
CONFIGURACIÓN DE REGISTROS INVERSOS
nano /etc/bind/db.10.0.0
0.0.10.in-addr.arpa.
IN SOA ns1.iespoligonosur.org.
admin.iespoligonosur.org. (
2 ;Serial
60480 ;Refresh
86400 ;Retry
2419200 ;Expire
60480 ) ;Negative Cache TTL
;
0.0.10.in-addr.arpa.
IN NS ns1.iespoligonosur.org.
0.0.10.in-addr.arpa.
IN NS ns2.iespoligonosur.org.
2.0.0.10.in-addr.arpa.
IN PTR ns1.iespoligonosur.org.
3.0.0.10.in-addr.arpa.
IN PTR ns2.iespoligonosur.org.
4.0.0.10.in-addr.arpa.
IN PTR ftp.iespoligonosur.org.
nano /etc/bind/db.192.168.127
127.168.192.in-addr.arpa.
IN SOA ns1.iespoligonosur.org.
admin.iespoligonosur.org. (
2 ;Serial
60480 ;Refresh
86400 ;Retry
2419200 ;Expire
60480) ;Negative Cache TTL
;
127.168.192.in-addr.arpa.
IN NS ns1.iespoligonosur.org.
127.168.192.in-addr.arpa.
IN NS ns2.iespoligonosur.org.
11.127.168.192.in-addr.arpa.
IN PTR pc01.1asir.iespoligonosur.org.
nano /etc/bind/db.192.168.128
128.168.192.in-addr.arpa.
IN SOA ns1.iespoligonosur.org.
admin.iespoligonosur.org. (
2 ;Serial
60480 ;Refresh
86400 ;Retry
2419200 ;Expire
60480) ;Negative Cache TTL
;
128.168.192.in-addr.arpa.
IN NS ns1.iespoligonosur.org.
128.168.192.in-addr.arpa.
IN NS ns2.iespoligonosur.org.
11.128.168.192.in-addr.arpa.
IN PTR pc01.2asir.iespoligonosur.org.
service bind9 restart
nslookup
SECUNDARIO
EN DNS1:
nano /etc/bind/named.conf.options
#Dentro de options
notify yes; # MASTER notifica a SLAVE
cuando se realicen cambios en registros
nano /etc/bind/named.conf.local
acl secundarios {
10.0.0.3;
};
#dentro de cada zona
allow-transfer{secundarios;};
EN DNS2:
CONFIGURACIÖN DE LA RED
nano /etc/network/interfaces
# This file describes the network
interfaces available on your system
# and how to
activate them. For more information, see interfaces(5).
# The loopback
network interface
auto lo
iface lo inet
loopback
# The primary
network interface
allow-hotplug eth0
iface eth0 inet
dhcp
auto eth1
iface eth1 inet
static
address
10.0.0.3
netmask
255.255.255.0
nano /etc/resolv.conf
nameserver 127.0.0.1
nano
/etc/bind/named.conf.local
//DIRECTA
zone
"iespoligonosur.org."{
type
slave;
file
"/etc/bind/db.iespoligonosur.org";
masters
{10.0.0.2;};
};
zone
"1asir.iespoligonosur.org."{
type
slave;
file
"/etc/bind/db.iespoligonosur.1asir.org";
masters
{10.0.0.2;};
};
zone
"2asir.iespoligonosur.org."{
type
slave;
file
"/etc/bind/db.iespoligonosur.2asir.org";
masters
{10.0.0.2;};
};
//INVERSA
zone
"0.0.10.in.addr.arpa"{
type
slave;
file
"/etc/bind/db.10.0.0";
masters
{10.0.0.2;};
};
zone
"127.168.192.in.addr.arpa"{
type
slave;
file
"/etc/bind/db.192.168.127";
masters
{10.0.0.2;};
};
zone
"128.168.192.in.addr.arpa"{
type
slave;
file
"/etc/bind/db.192.168.128";
masters
{10.0.0.2;};
};
chmod 2775 /etc/bind/
service bind9 restart
Y EN DNS1:
service bind9 restart
COMPROBACION:
En ambos servidores
tail -n50 /var/log/syslog
nslookup
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
Configuración
de un servidor FTP en Debian:
INSTALACIÓN
apt-get update
apt-get install vsftpd ssh
CONFIGURACIÖN DE LA RED
nano /etc/network/interfaces
# This file describes the network
interfaces available on your system
# and how to
activate them. For more information, see interfaces(5).
# The loopback
network interface
auto lo
iface lo inet
loopback
# The primary
network interface
allow-hotplug eth0
iface eth0 inet
dhcp
auto eth1
iface eth1 inet
static
address
10.0.0.2
netmask
255.255.255.0
CONEXIÓN REMOTA
ssh root@192.168.0.17
CONFIGURACIÓN FTP
service vsftpd restart
/srv/ftp
#
nano /etc/vsftpd.conf
Descomentamos
para habilitar los usuarios locales local_enable=YES
Descomentamos
para dejar escribir a los usuarios locales write_enable=YES
Para
que el usuario vea su propia carpeta y no las demás:
chroot_local_user=YES
Cambias
el mensaje de Bienvenida: ftpd_banner=Bienvenido
al Servidor FTP de PEPA
Otras
opciones que vemos en el fichero de configuración que se puede usar
un certificado externo:
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_cert_file=/etc/ssl/private/vsftpd.pem
Podemos
configurar un listado de usuarios que no queremos que estén
enjaulados:
chroot_list_file=/etc/vsftpd.chroot_list
chroot_list_file=/etc/vsftpd.chroot_list
service
vsftpd restart
adduser
pepa
CONFIGURACIÓN FTP con openSSL
apt-get
install openssl
mkdir
-p /etc/ssl/private
chmod
700 /etc/ssl/private
openssl
req -x509 -nodes -days 365 -newkey rsa:1024 -keyout
/etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem
nano
/etc/vsftpd.conf
# Turn on SSL ssl_enable=YES # Allow anonymous users to use secured SSL connections allow_anon_ssl=YES # All non-anonymous logins are forced to use a secure SSL connection in order to # send and receive data on data connections. force_local_data_ssl=YES # All non-anonymous logins are forced to use a secure SSL connection in order to send the password. force_local_logins_ssl=YES # Permit TLS v1 protocol connections. TLS v1 connections are preferred ssl_tlsv1=YES # Permit SSL v2 protocol connections. TLS v1 connections are preferred ssl_sslv2=NO # permit SSL v3 protocol connections. TLS v1 connections are preferred ssl_sslv3=NO # Disable SSL session reuse (required by WinSCP) require_ssl_reuse=NO # Select which SSL ciphers vsftpd will allow for encrypted SSL connections (required by FileZilla) ssl_ciphers=HIGH # This option specifies the location of the RSA certificate to use for SSL # encrypted connections. rsa_cert_file=/etc/ssl/private/vsftpd.pem
service vsftpd restart
Comentarios
Publicar un comentario
Si te ha gustado, haz un comentario, ..., GRACIAS