Main menu:

Site search

Categories

março 2010
D S T Q Q S S
« abr    
 123456
78910111213
14151617181920
21222324252627
28293031  

Tags

Lista de Links

Fluxograma do Linux/Netfilter/Iptables

Senhores

segue um bom fluxograma dos pacotes de rede que passa pelo subsistema de firewall e roteamento do Linux/Netfilter e Iptables:

Fluxograma do Iptables

Fluxograma do Iptables

Essa figura foi achada no site http://www.frozentux.net que me parece uma boa referencia sobre o sistema de firewall do Linux.

Resumo de expressão regular

Aproveitando o mesmo post que fiz a algum tempo atrás, segue um resumo dos metacaracteres de Expressões Regulares:

  • . (ponto): casa com qualquer coisa, uma única vez;
  • [ ... ] (lista): casa com alguma coisa que está dentro da lista (mas um único elemento);

    • [^ ... ] (lista negada): casa com qualquer coisa, exceto o que está dentro da lista;
    • [ ... ^]: transforma o circunflexo em um caracter literal;
    • [x-y] (faixa de elementos dentro da lista): indica uma faixa de elementos de x até y;
    • [...-]: transforma o traço em um caracter literal;
    • []]: transforma o conchete ] em um caracter literal;
  • ? (opcional): existe ou não seu predecessor;
  • *: pode existir, e repetidamente ou não seu predecessor;
  • +: existe pelo menos uma vez seu predecessor;
  • {n,m} : existe o mínimo n e no máximo m vezes seu predecessor;

    • {n} : existe exatamente n vezes seu predecessor;
    • {n,} : existe, pelo menos n vezes seu predecessor;
    • {,m} : existe, de zero até m vezes seu predecessor;
  • ^: no inicio de uma ER, indica inicio de linha;
  • $: no final de uma ER, indica final de linha;
  • \b (borda): indica borda de palavras (strings formadas somente com A-Za-z0-9_)
  • \ (escape): transforma metacarteres em caracteres literais;
  • | (ou): alterna entre uma sequencia de caracter (ou isso ou aquilo);
  • (): agrupa ERs;
  • \1\9 (retrovisores): casa com a sequencia de caracteres casados na ER anterior agrupadas.

LPI

Senhores

Segue o link sobre os tópicos da PLI, que entrará em vigor no dia 1º de Abril de 2009 (na próxima segunda).

https://group.lpi.org/publicwiki/bin/view/Examdev/LPIC-20x

Vamos começar a preparar para a 202.

Abaixo, levantamento dos tópicos:

Topic 208 Web Services
208.1 Implementing a web server
Weight     3

Key Knowledge Areas
* Apache 2.x configuration files, terms and utilities
* Apache log files configuration and content
* Access restriction methods and files
* mod_perl and PHP configuration
* Client user authentication files and utilities
* Configuration of maximum requests, minimum and maximim servers and clients

The following is a partial list of the used files, terms and utilities:
* access logs and error logs
* .htaccess
* httpd.conf
* mod_auth
* htpasswd
* htgroup
* apache2ctl
* httpd

208.2 Maintaining a web server
Weight     2

Key Knowledge Areas
* SSL configuration files, tools and utilities
* SSL certificate handling
* Apache 2.x virtual host implementation (with and without dedicated IP addresses)
* Using redirect statements in Apache’s configuration files to customise file access

The following is a partial list of the used files, terms and utilities:
* Apache2 configuration files
* /etc/ssl/*
* openssl

208.3 Implementing a proxy server
Weight     1

Key Knowledge Areas
* Squid 2.x configuration files, terms and utilities
* Access restriction methods
* Client user authentication methods
* Layout and content of ACL in the Squid configuration files

The following is a partial list of the used files, terms and utilities:
* squid.conf
* acl
* http_access

============================================================================================
Topic 209: File Sharing
209.1 SAMBA Server Configuration
Weight     4

Key Knowledge Areas
* Samba 3 documentation
* Samba configuration files
* Samba tools and utilities
* Mounting Samba shares on Linux
* Samba daemons
* Mapping Windows usernames to Linux usernames
* User-Level and Share-Level security

The following is a partial list of the used files, terms and utilities:
* smbd, nmbd
* smbstatus, testparm, smbpasswd, nmblookup
* smbclient
* net
* /etc/smb/*
* /var/log/samba/

209.2 NFS Server Configuration
Weight     4

Key Knowledge Areas
* NFS configuration files
* NFS tools and utilities
* Access restrictions to certain hosts and/or subnets
* Mount options on server and client
* tcpwrappers

The following is a partial list of the used files, terms and utilities:
* /etc/exports
* exportfs
* showmount
* nfsstat
* /proc/mounts
* /etc/fstab
* rpcinfo
* mountd
* portmapper

============================================================================================
Topic 210 Network Client Management
210.1 DHCP configuration
Weight     2

Key Knowledge Areas
* DHCP configuration files, terms and utilities
* Subnet and dynamically-allocated range setup

The following is a partial list of the used files, terms and utilities:
* dhcpd.conf
* dhcpd.leases
* /var/log/daemon.log and /var/log/messages
* arp
* dhcpd

210.2 PAM authentication
Weight     3

Key Knowledge Areas
* PAM configuration files, terms and utilities
* passwd and shadow passwords

The following is a partial list of the used files, terms and utilities:
* /etc/pam.d
* pam.conf
* nsswitch.conf
* pam_unix, pam_cracklib, pam_limits, pam_listfile

210.3 LDAP client usage
Weight     2

Key Knowledge Areas
* LDAP utilities for data management and queries
* Change user passwords
* Querying the LDAP directory

The following is a partial list of the used files, terms and utilities:
* ldapsearch
* ldappasswd
* ldapadd
* ldapdelete

============================================================================================
Topic 211: E-Mail Services
211.1 Using e-mail servers
Weight     3

Key Knowledge Areas
* Configuration files for postfix
* Basic knowledge of the SMTP protocol, sendmail, and exim

The following is a partial list of the used files, terms and utilities:
* Configuration files and commands for postfix
* Basic configuration of sendmail
* /etc/aliases
* /etc/mail/*
* /etc/postfix/*
* sendmail emulation layer commands
* /var/spool/mail
* mail-related logs in /var/log/

211.2 Managing Local E-Mail Delivery
Weight     2

Key Knowledge Areas
* procmail configuration files, tools and utilities
* Usage of procmail on both server and client side

The following is a partial list of the used files, terms and utilities:
* ~/.procmail
* /etc/procmailrc
* procmail
* mbox and Maildir formats

211.3 Managing Remote E-Mail Delivery
Weight     2

Key Knowledge Areas
* Courier IMAP and Courier POP configuration
* Dovecot configuration

The following is a partial list of the used files, terms and utilities:
* /etc/courier/*
* dovecot.conf

============================================================================================
Topic 212: System Security
212.1 Configuring a router
Weight     3

Key Knowledge Areas
* iptables configuration files, tools and utilities
* Tools, commands and utilities to manage routing tables.
* Private address ranges
* Port redirection and IP forwarding
* List and write filtering and rules that accept or block datagrams based on source or destination protocol, port and address
* Save and reload filtering configurations

The following is a partial list of the used files, terms and utilities:
* /proc/sys/net/ipv4
* /etc/services
* iptables
* routed

212.2 Securing FTP servers
Weight     2

Key Knowledge Areas
* Configuration files, tools and utilities for Pure-FTPd and vsftpd
* Awareness of ProFTPd?
* Understanding of passive vs. active FTP connections

The following is a partial list of the used files, terms and utilities:
* vsftpd.conf
* important Pure-FTPd command line options

212.3 Secure shell (SSH)
Weight     4

Key Knowledge Areas
* OpenSSH configuration files, tools and utilities
* Login restrictions for the superuser and the normal users
* Managing and using server and client keys to login with and without password
* Usage of XWindow and other application protocols through SSH tunnels
* Configuration of ssh-agent
* Usage of multiple connections from multiple hosts to guard against loss of connection to remote host following configuration changes

The following is a partial list of the used files, terms and utilities:
* ssh
* sshd
* /etc/ssh/sshd_config
* Private and public key files
* ~/.ssh/authorized_keys
* PermitRootLogin?, PubKeyAuthentication?, AllowUsers?, PasswordAuthentication?, Protocol

212.4 TCP Wrapper
Weight     1

Key Knowledge Areas
* TCP Wrapper configuration files, tools and utilities
* inetd configuration files, tools and utilities

The following is a partial list of the used files, terms and utilities:
* /etc/inetd.conf
* /etc/hosts.allow
* /etc/hosts.deny
* libwrap
* tcpd

212.5 Security tasks
Weight     3

Key Knowledge Areas
* Tools and utilities to scan and test ports on a server
* Locations and organisations that report security alerts as Bugtraq, CERT, CIAC or other sources
* Tools and utilities to implement an intrusion detection system (IDS)
* Awareness of OpenVAS?

The following is a partial list of the used files, terms and utilities:
* telnet
* nmap
* snort
* fail2ban
* nc
* iptables

============================================================================================
Topic 213: Troubleshooting
213.1 Identifying boot stages and troubleshooting bootloaders
Weight     4

Key Knowledge Areas
* boot loader start and hand off to kernel
* kernel loading
* hardware initialisation and setup
* daemon/service initialisation and setup
* Know the different bootloader install locations on a hard disk or removable device
* Overwriting standard bootloader options and using bootloader shells

The following is a partial list of the used files, terms and utilities:
* The contents of /boot/ and /boot/grub/
* GRUB
* grub-install
* initrd, initramfs
* Master boot record
* /etc/init.d
* lilo
* /etc/lilo.conf

213.2 General troubleshooting
Weight     5

Key Knowledge Areas
* /proc filesystem
* Various system and daemon log files
* Content of /, /boot , and /lib/modules
* Screen output during bootup
* Kernel syslog entries in system logs (if entry is able to be gained)
* Tools and utilities to analyse information about the used hardware
* Tools and utilities to trace software and their system and library calls

The following is a partial list of the used files, terms and utilities:
* dmesg
* /sbin/lspci
* /usr/bin/lsdev
* /sbin/lsmod
* /sbin/modprobe
* /sbin/insmod
* /bin/uname
* strace
* strings
* ltrace
* lsof
* lsusb

213.3 Troubleshooting system resources
Weight     5

Key Knowledge Areas
* Core system variables
* The contents of:
o /etc/profile && /etc/profile.d/
o /etc/init.d/
o /etc/rc.*
o /etc/sysctl.conf
o /etc/bashrc
o /etc/ld.so.conf
o or other appropriate global shell configuration files
* Any standard editor
* Standard tools, utilites and commands to manipulate the above files and variables

The following is a partial list of the used files, terms and utilities:
* /bin/ln
* /bin/rm
* /sbin/ldconfig
* /sbin/sysctl

213.4 Troubleshooting environment configurations
Weight     5

Key Knowledge Areas
* Core system variables
* init configuration files
* init start process
* cron configuration files
* Login process
* User-password storage files
* Determine user group associations
* SHELL configuration files of bash
* Analysing which processes or daemons are running

The following is a partial list of the used files, terms and utilities:
* /etc/inittab
* /etc/rc.local
* /etc/rc.boot
* /var/spool/cron/crontabs/
* The default shell configuration file(s) in /etc/
* /etc/login.defs
* /etc/syslog.conf
* /etc/passwd
* /etc/shadow
* /etc/group
* /sbin/init
* /usr/sbin/cron
* /usr/bin/crontab

Projeto eSpeak

O projeto eSpeak pega uma string e converte em som. Sua versão atual suporta diversas linguas.

Para instalar no fedora 10, execute o comando:

# yum install espeak

Feito isso basta executar da seguinte forma:

# espeak “Test voice”

Por padrão sua lingua é inglesa. Para ler um texto em portugues (do Brasil) execute da seguinte forma:

# espeak -vpt “Olá, estou falando com intonação em português. Tudo bem com você?”

Para saber quais são os idiomas suportados pelo espeak, execute o seguinte comando:

# espeak –voices

Existem interfaces gráficas para essa excelente ferramenta, uma delas é o GeSpeak, até o momento de escrever este micro artigo, não tinha seu pacote compilado para o Fedora.

Projeto de estudo para o primeiro semestre

Após a prova 201 da LPI, meu foco por um mês e pouco serão esses itens:

  • Sistemas Operacionais Linux/UNIX: sistema de arquivos, programação shell script.
  • Configuração de servidores e aplicativos: correio eletrônico, DNS, Web (Apache, TomCat), Nagios, WebMail, LDAP, Radius, SAMBA, FTP, Raid “disk arrays”, máquinas virtuais (XEN, KVM, VMWare).
  • Segurança de rede: firewalls (IPTABLES), protocolos de criptografia, certificados digitais, configuração de antivírus para servidores Linux/Unix.
  • Administração de servidores: instalação e configuração de sistemas operacionais compatíveis com Linux/UNIX, manutenção, criação de usuários e atribuições seguras de direitos, políticas de backup, filas de impressão em rede, análise de “logs”, manutenção de usuários e contas de e-mail.
  • Planejamento de projetos de segurança: IDS (Intrusion Detection Systems), autenticação, firewall, access-list, Switches camada 7.
  • Conceito de redes e segurança em plataformas Microsoft Windows, planejamento e configuração de redes TCP/IP.
  • Conceito de VPN (Virtual Private Networks).
  • Configuração de software livre de apoio ao ensino (MOODLE).

Muitos desses itens já serão base para a prova 202 da LPI, outros da prova 201 e certificação de nível 1

LPI - 2 - prova 202

Microblog - Twitter

Senhores

Também estou no Twitter, um microblog que pode postar msgs com até 140 caracteres.

E pelo que estou vendo, muitas pessoas estão apostando nele, devido a simplicidade e rapidez.

Vamos ver o que dá!, rs

http://www.twitter.com/rdiogo

Converter imagem do VMWARE para KVM

Senhores

recentemente estou começando a trabalhar com máquina virtual que já vem nativa no Linux. Das que pesquisei as mais fáceis de trabalhar é KVM e XEN. Como estou usando o Fedora 10, percebi que o Kernel com XEN para ser Dom0 (kernel para máquina hospedeira) não está disponível, então sobrou somente o KVM.

Antigamente utilizava o VMWARE para trabalhar com máquinas virtuais, porém sempre tive muitos problemas para a compilação dos módulos do mesmo para funcionar no Fedora. Por este motivo (perco muito tempo pesquisando, testando, e a cada atualização do Kernel a dor de cabeça é a mesma) estou começando a usar o KVM.

Neste artigo estou documentando somente a conversão da imagem de máquina virtual do VMWARE para o formato que o KVM aceita.

Sites onde achei as documentações que estou postando:

O último é o que estou usando, pois existem vários arquivos no formato vmdk.

No diretório onde se encontra a imagem que estou convertendo tem os seguintes arquivos:

-rw------- 1 root root 1805058048 Nov  4 17:56 Windows XP Professional-s001.vmdk
-rw------- 1 root root  799997952 Nov  4 17:56 Windows XP Professional-s002.vmdk
-rw------- 1 root root  675741696 Nov  4 17:56 Windows XP Professional-s003.vmdk
-rw------- 1 root root     393216 Nov  4 17:56 Windows XP Professional-s004.vmdk
-rw------- 1 root root      65536 Nov  4 17:56 Windows XP Professional-s005.vmdk
-rw------- 1 root root        580 Nov  4 17:22 Windows XP Professional.vmdk

Então necessito converter todos esses arquivos:

# cd /path/to/vmare/image/Windows\ XP\ Professional/
# for I in *[0-9].vmdk; do qemu-img convert -f vmdk "$I" -O raw /var/lib/libvirt/images/"$I"; done
# cd /var/lib/libvirt/images/
# cat *.vmdk >> WinXPpro.img

Obs.: no comando cat acima, verifique se estes estão sendo anexados na ordem.

Após essa conversão e anexação dos arquivos em um arquivo somente, bastou criar uma máquina virtual, apontando para este arquivo e o processo de boot ocorreu normalmente.

Obs.: ainda preciso pesquisar como funciona a questão da parte de vídeo, já que no VMWARE não trabalhava com VNC.

Games no linux

Senhores

existem muitos jogos para linux. Muitos acabam sendo desconhidos pois não são de produtoras famosas como a EA, entre outros.

Não esperem, ainda, que existem jogos cujo a imagem é muito bem trabalhada, isto vem do fato do avanço lento dos drivers 3D para placas de vídeo ou desses serem proprietários e não incluso nativamente nas distribuições mais populares (não vou argumentar isso, pois cada projeto tem seu escopo e opinião).

Mas a algum tempo, fiz uma lista de jogos que achei interessante (apesar do tempo que tive para jogar foi muito pouco):

  • lincity
  • slingshot
  • Drascula
  • tuxpuck
  • UFO

Quem gosta, fiquem a vontade.

[]s

sed e expressão regular

Senhores

Algumas coisas extremamente básica sobre o uso do sed e algumas expressões regulares (a serem usadas pelo sed).

  • Expressão regular: Validação de endereçamento IP
[1-9][0-9]{0,2}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}
  • Remover pontos no inicio da string e pontos duplicados
REG=$(echo $REG | sed 's/\.\{1,\}/\./g' | sed 's/^\.//')
  • Remove o ponto no inicio da setenca se existir
sed 's/^\.//'
  • Remove pontos duplicados em todo o texto
sed 's/\.\{1,\}/\./g'
  • Remove o ponto final se existir
sed 's/\.$//'

Gentoo - Instalações prioritárias

Senhores

este post foi criado para marcar as prioridades que tenho para testar uma nova instalação do Gentoo:

  • som e microfone
  1. skype
  2. gnome
  3. flash
  • webcam
  • wireless

Ou seja, numa próxima instalação, pretendo fazer por etapas e documentando, dando ênfase nos ítens acima, para que fique documentado.

Atenciosamente