lunes, 21 de septiembre de 2015

TFTP Server Ubuntu 14.04

Mucho hardware de red todavía utiliza TFTP para subir y bajar configuraciones y para copiar firmware, etc.
Existen pequeños programas para windows que como administrador de sistemas te sacan del apuro cundo los necesitas, pero en este articulo trataremos de explicar como configurar un servidor TFTP en Ubuntu.

Elegimos tftpd-hpa por que no tiene limitacion de 32MB (atftpd la tiene) y por que permite que utilicemos los comandos put y get.

Instalamos el cliente tftp, y los demonios tftpd-hpa y xinetd
apt-get install tftp tftpd-hpa xinetd

Una vez instalado configuramos los siguiente archivos de la siguiente manera:
root@hostname:~# nano /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
#la opción --create es la que permite                               #que se puedan crear archivos cuando realizamos put
TFTP_OPTIONS="--secure --create"



root@hostname:~#nano /etc/inetd.conf
#FIJAROS QUE ESTA TODO COMENTADO
# /etc/inetd.conf:  see inetd(8) for further informations.
#
# Internet superserver configuration database
#
#
# Lines starting with "#:LABEL:" or "#<off>#" should not
# be changed unless you know what you are doing!
#
# If you want to disable an entry so it isn't touched during
# package updates just comment it out with a single '#' character.
#
# Packages should modify this file by using update-inetd(8)
#
# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
#
#:INTERNAL: Internal services
#discard                stream  tcp     nowait  root    internal
#discard                dgram   udp     wait    root    internal
#daytime                stream  tcp     nowait  root    internal
#time           stream  tcp     nowait  root    internal
#:STANDARD: These are standard services.
#:BSD: Shell, login, exec and talk are BSD protocols.
#:MAIL: Mail, news and uucp services.
#:INFO: Info services
#:BOOT: TFTP service is provided primarily for booting.  Most sites
#       run this only on machines acting as "boot servers."
#:RPC: RPC based services
#:HAM-RADIO: amateur-radio services
#:OTHER: Other services

Por si acaso alguno tiene iniciativa recordar que NO hay que crear un archivo dentro de la ruta /etc/xinet.d/tftpd o algo parecido

A continuación creamos los directorios necesarios y asignamos los  permisos adecuados.
root@hostname:~# sudo mkdir /var/lib/tftpboot
root@hostname:~# sudo chmod -vfR 777 /var/lib/tftpboot
root@hostname:~# sudo chown -vfR tftp:tftp /var/lib/tftpboot

Reiniciamos los servicios
root@hostname:~# sudo service xinetd stop;sudo service tftpd-hpa stop;sudo service tftpd-hpa start;sudo service xinetd start

Comprobamos que se esta ejecutando el servicio TFTPD
root@hostname:~# ps -aux | grep tftpd
root     29285  0.0  0.0  15088   332 ?        Ss   20:07   0:00 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure --create /var/lib/tftpboot
root@hostname:~# netstat -nap | grep tftp
udp        0      0 0.0.0.0:69              0.0.0.0:*                           29285/in.tftpd
unix  2      [ ]         DGRAM                    98078    29285/in.tftpd

Ahora podemos probar el tftp con el cliente
root@hostname:~# tftp 127.0.0.1
tftp> ?
Commands may be abbreviated.  Commands are:

connect         connect to remote tftp
mode            set file transfer mode
put             send file
get             receive file
quit            exit tftp
verbose         toggle verbose mode
trace           toggle packet tracing
status          show current status
binary          set mode to octet
ascii           set mode to netascii
rexmt           set per-packet retransmission timeout
timeout         set total retransmission timeout
?               print help information

tftp>quit

#

Ref: http://spysnooper.blogspot.mx/2013/03/servidor-tftp-en-ubuntu-con-permisos-de.html



miércoles, 9 de septiembre de 2015

lunes, 7 de septiembre de 2015

Backup Firewall Fortigate Sever TFTP


En este Blog veremos cómo respaldar la configuración de los Firewall Fortigate a través de un servidor TFTP. Simulando que nuestro server tiene la dirección ip 192.168.1.100 y nuestro Firewall 192.168.1.30

1. Lo primero que tenemos que hacer es iniciar un servidor TFTP ya sea de Linux o Windows

2. Ingresamos al Firewall que vamos a respaldar y ejecutamos el siguiente comando:

Con un solo comando corremos y respaldamos la configuración:

execute backup full-config tftp FW350C.cfg 192.168.1.100 [<password_str>]

FW350C.cfg: Es el nombre del archivo con el que guardaremos la configuración total de Firewall.

[<password_str>]: Podemos colocar un password para darle mayor seguridad a nuestro bakup, esto parámetro es opcional.

3. Para cargar el respaldo a nuestro fortigate

execute restore config tftp FW350C.cfg 192.168.55.100 [<backup-password_str>]

[<backup-password_str>]: En caso de haber respaldado con contraseña aquí la debemos colocar.

 Comandos basicos para MY SQL en linea de comando Muestra las bases de datos creadas previamete. show databases; Para utilizar la base de da...