ubuntu server e windows em ambiente virtualizado ( instalação ) ubuntu server e windows em...
TRANSCRIPT
![Page 1: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/1.jpg)
Ubuntu Server e Windows Em Ambiente Virtualizado( Instalação )
Prof. Fernando Legore
![Page 2: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/2.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 2
Objetivo
Montar uma rede em ambiente virtualizado, onde um Servidor Linux (Ubuntu Server) irá oferecer os serviços de DHCP, DNS, NAT, Compartilhamento de Arquivos (Samba) e compartilhamento de rede Internet.
![Page 3: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/3.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 3
Virtualização
![Page 4: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/4.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 4
Virtualização
A virtualização permite que várias instâncias do sistema operacional sejam executadas simultaneamente em um único computador.
É uma forma de abstrair o hardware de um único sistema operacional. Todos os sistemas operacionais “convidados” são gerenciados por um VMM (Virtual Machine Monitor)
A virtualização permite que um operador controle o uso da CPU, memória, armazenamento e de outros recursos do sistema operacional do convidado, de forma que cada convidado receba apenas os recursos que precise.
Este controle elimina o risco de um processo que consuma toda a memória disponível ou a CPU.
![Page 5: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/5.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 5
Virtualização
![Page 6: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/6.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 6
Ubuntu Server – Download da Imagem ISO
![Page 7: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/7.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 7
Ubuntu Server – Download da Imagem ISO
![Page 8: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/8.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 8
Criação de uma Máquina Virtual – Ubuntu Server
![Page 9: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/9.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 9
Criação de uma Máquina Virtual – Ubuntu Server
![Page 10: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/10.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 10
Criação de uma Máquina Virtual – Ubuntu Server
![Page 11: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/11.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 11
Criação de uma Máquina Virtual – Ubuntu Server
![Page 12: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/12.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 12
Criação de uma Máquina Virtual – Ubuntu Server
-VDI é o formato nativo do VirtualBox e significa apenas Imagem de Disco Virtual.
- VMDK é o formato original da VMWare, aceito pelo VirtualBox e significa que é dinamicamente alocado, ou seja, apesar de ter um tamanho máximo fixo, só ocupa o espaço que for sendo armazenado no sistema virtual.
- VHD é o formato nativo do Microsoft Virtual PC, aceito pelo VirtualBox e significa apenas HD Virtual.
- HDD é a designação genérica para Hard Disc Digital.
- QED, novo formato de disco Linux. Foi projetado para ser muito mais rápido do que outros formatos de disco para os usuários de virtualização.
- QCOW é um formato de arquivo para imagem de disco virtual.
Fonte(s):Experimentos & Observações™Normatização, Idéias e Ações®
![Page 13: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/13.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 13
Criação de uma Máquina Virtual – Ubuntu Server
![Page 14: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/14.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 14
Configuração das Interfaces de Rede
![Page 15: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/15.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 15
Configuração das Interfaces de Rede - VM
![Page 16: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/16.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 16
Instalação do Ubuntu Server
Deixar o segundo adaptador de rede, com a configuração acima apresentada.Essa será usada internamente entre duas máquinas virtuais. Servidor Ubuntu e Windows XP
![Page 17: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/17.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 17
Ubuntu Server
![Page 18: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/18.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 18
Instalação do Ubuntu Server
![Page 19: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/19.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 19
Instalação do Ubuntu Server
![Page 20: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/20.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 20
Instalação do Ubuntu Server
![Page 21: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/21.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 21
Instalação do Ubuntu Server
![Page 22: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/22.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 22
Instalação do Ubuntu Server
![Page 23: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/23.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 23
Instalação do Ubuntu Server
![Page 24: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/24.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 24
Instalação do Ubuntu Server
![Page 25: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/25.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 25
Instalação do Ubuntu Server
![Page 26: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/26.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 26
Instalação do Ubuntu Server
![Page 27: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/27.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 27
Instalação do Ubuntu Server
![Page 28: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/28.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 28
Instalação do Ubuntu Server
![Page 29: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/29.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 29
Instalação do Ubuntu Server
![Page 30: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/30.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 30
Instalação do Ubuntu Server
![Page 31: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/31.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 31
Instalação do Ubuntu Server
![Page 32: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/32.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 32
Instalação do Ubuntu Server
![Page 33: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/33.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 33
Instalação do Ubuntu Server
![Page 34: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/34.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 34
Comandos Básicos (1)
Comandos (1)
uname –a apresenta as informações do sistemawho mostra quem (usuário) que está conectado ao hostuptime tempo em que o sistema está em funcionamentotop janela de processos em tempo realinit 0 desliga o sistema (shutdown –h now)eject /eject –t abre e fecha o CD-ROMcp copia de arquivos e diretórios (-R recusivo)mv move e renomeia arquivos/diretóriosrm apaga arquivos/diretóriosmkdir cria diretóriols lista diretórioslspci lista de harwares pci (rede, usb, ...)ssh acesso remoto a plataforma Unix/Linux (ambiente texto)
Esses comandos podem ser executados de qualquer lugar (dentro de qualquer diretório)
![Page 35: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/35.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 35
Raiz de diretórios (Árvore)tree -d -C –L 2 | more Comando similar, utilizando no
ambiente Windows ( tree | more)
Observação: necessário instalar (apt-get install tree)
![Page 36: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/36.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 36
Árvore de Diretório
Locais para configurações do sistema (diretório /etc)
Interfaces de rede: /etc/network/interfacesNome da máquina: /etc/hostnameNome do computador e seu endereço IP /etc/hostsListagem de Usuários (*) /etc/passwdListagem de Senhas (*) /etc/shadowListagem de Grupos (*) /etc/groupServidor DHCP: /etc/dhcpd/dhcpd.confServidor Apache: /etc/apache2/apache2.confServidor DNS: /etc/bind/named.confArquivos ou links de inicialiazação /etc/init.dArquivo para iniciar demais serviços /etc/rc.local
Comando de entrada e saída: cdExemplo: cd /etc/network
Para edição de todos os arquivos, utilize um editor de texto a sua escolha(mc / nano / vim / vi ).
Exemplo: nano /etc/hostname
![Page 37: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/37.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 37
Configuração da Rede – Ubuntu Server
# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).
# The loopback network interfaceauto loiface lo inet loopback
# The primary network interfaceauto eth0iface eth0 inet static address 172.16.108.xxx netmask 255.255.255.224 network 172.16.108.0 broadcast 172.16.108.31 gateway 172.16.108.1 dns-nameservers 172.16.108.1
auto eth1iface eth1 inet static address 192.168.1.1 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255
nano /etc/network/interfaces
![Page 38: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/38.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 38
Comandos:
ifconfig - para exibir as configurações aplicadas as interfaces de redemii-tool – relata se as interfaces estão ou não conectadas a uma cabo ping - (Packet InterNet Groupe) Testa a comunicação
Configuração das Interfaces de redeRevendo...
![Page 39: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/39.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 39
Instalação do Windows XP
Segue os mesmospassos para instalaçãodo Ubuntu Server
![Page 40: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/40.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 40
Windows XP
![Page 41: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/41.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 41
Instalação do Windows XP
A instalação do Windows XP terá somente um adaptador (placa de rede). Essa será configurada como Placa de rede (host-only)
![Page 42: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/42.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 42
Configuração da Rede – Windows XP
![Page 43: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/43.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 43
Open SSH (Secure Shell)Acesso Remoto
![Page 44: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/44.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 44
Open SSH (Secure Shell)
Port 22
PermitRootLogin yes
# Banner /etc/issue.net
OpenSSH permite acesso remoto a outro computador na rede permitindo a execução completa de todos os comandos, bastando que o usuário logado tenha sido autorizado. O SSH faz parte da suíte de protocolos TCP/IP que torna segura a administração remota de servidores do tipo Unix.
Port 2222
PermitRootLogin no
Banner /etc/issue.netMudança na configuração
/etc/ssh/sshd_configArquivo de configuração
Sugestão de modificações no arquivo de configuração:
• Porta 22 é muito conhecida a existência de senhas fracas poderá permitir acesso de pessoas não autorizadas;• Negar que um usuário logue diretamente como root (administrador), força o mesmo a passar por duas senhas;• Criar um banner informando que o acesso a essa área é destinada a somente pessoas autorizadas é ético.
![Page 45: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/45.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 45
Open SSH (Secure Shell)
O SSH pode ser acessado entre máquinas Unix/Linux via linha de comando
Exemplo:ssh [email protected] –p 22
ou por meio de softwares (no caso de windows para Linux/Unix)
Putty é o software mais conhecido deles.
![Page 46: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/46.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 46
NATNetwork Address Translation
(compartilhamento de rede internet)
![Page 47: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/47.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 47
NAT – Network Address TranslationNAT - Network Address Translation, também conhecido como masquerading é uma técnica que consiste em reescrever os endereços IP de origem de um pacote que passam por um router ou firewall de maneira que um computador de uma rede interna tenha acesso ao exterior ou Rede Mundial de Computadores
![Page 48: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/48.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 48
NAT – Network Address Translation
![Page 49: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/49.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 49
NAT – Network Address Translation
Dentro de uma empresa costumeiramente há pessoas/programas para monitorar o que ocorre.
As imagens podem ser trafegadas juntamente com os demais dados da rede intranet.
Nesse caso, não há a necessidade de qualquertipo de roteamento.
Para o acesso das câmeras através da rede externa, isto é, monitoramento de casa ou móvel, torna-se necessário um roteamento , o qual seja feita por NAT.
Logo, de dentro da rede pra fora é necessário modificar o pacote.
PREROUTING
![Page 50: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/50.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 50
NAT – Network Address Translation
Dentro de uma empresa é comum o uso de endereços IP inválidos (internos).
Esses endereços permitem que a comunicação entre os computadores dessa empresa, isto é, cada usuário/computador conhece seu endereçoc IP e o endereço do colega (vizinho).
No caso de NAT, um endereço IP válido é traduzido em outro endereço IP (IP inválido).
Um usuário fora da rede da empresa (externo), não consegue ver o endereço IP interno do usuário.
POSTROUTING
![Page 51: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/51.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 51
INTERNOEthernet 1192.168.1.0/24
EXTERNOEthernet 0 172.16.108.0/27
NAT – Network Address Translation
Nesse curso, será considerado os seguintes endereços de rede para criação de mascaramento e regras de Firewall.
Em um servidor Linux será utilizado regras de NAT através do IPTABLES
IPTABLES
É um Firewall que atua em nÍveis de pacotes, ou seja, ele toma decisões baseadas em parâmetros do pacote, como porta/endereço de origem/destino, estado da conexão e outros parâmetros do pacote.Funciona através da comparação de regras para saber se um pacote tem ou não permissão para passar.
![Page 52: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/52.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 52
NAT – Network Address Translation
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADEecho 1 > /proc/sys/net/ipv4/ip_forward
1ª. Sugestão:Regra Básica de NAT (compartilhamento de Internet para dentro da rede da empresa/residência)
echo "Lista de IPs Livres para Navegacao“for IPLIVRES in $(cat /etc/firewall/ip_livres.txt); doiptables -t nat -A POSTROUTING -s $IPLIVRES -j MASQUERADEecho "->" $IPLIVRESdoneecho 1 > /proc/sys/net/ipv4/ip_forward
3ª. Sugestão:Criado uma lista de endereços IP em arquivo a parte (ip_livres.txt), o laço for percorre todas alinhas do arquivo liberando os endereços IP cadastrados.
2ª. Sugestão:A regra aqui faz NAT para o protocolo ICMP (ping) e para as portas 80 e 443. Respectivamentehttp e https
iptables -t nat -A POSTROUTING –s 192.168.1.0/24 -d 0/0 -p icmp -j MASQUERADEiptables -t nat -A POSTROUTING -s 192.168.1.0/24 -d 0/0 -p tcp -m multiport --dport 80,443 -j MASQUERADE
![Page 53: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/53.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 53
NAT – Network Address Translation
#!/bin/sh#-------------- Declaracao de variaveis -----------------------------#IPEXTERNO=192.168.2.187IPINTERNO=192.168.1.1REDEINTERNA=192.168.1.0/24
#---------------- Limpa regras existentes -----------------------------#iptables -Fiptables -t nat -Fiptables -Xiptables -t nat -X
#-(1)---------- NAT Regra Geral ---------------------------------------##iptables -t nat -A POSTROUTING -s $REDEINTERNA -j MASQUERADE
#-(2)------------ NAT por portas --------------------------------------#iptables -t nat -A POSTROUTING -s $REDEINTERNA -d 0/0 -p icmp -j MASQUERADEiptables -t nat -A POSTROUTING -s $REDEINTERNA -d 0/0 -p tcp -m multiport --dport 80,443 -j MASQUERADE
#-(3)---------- NAT Por IP -------------------------------------------##echo "Lista de IPs Livres para Navegacao"#for IPLIVRES in $(cat /etc/firewall/ip_livres.txt); do#iptables -t nat -A POSTROUTING -s $IPLIVRES -j MASQUERADE#echo "->" $IPLIVRES#done#echo 1 > /proc/sys/net/ipv4/ip_forward
#-------------------- Regras de Entrada, Saida e Passagem -------------------#iptables -A INPUT -s 0/0 -d $IPEXTERNO -p tcp -m multiport --dport 53,80 -j ACCEPTiptables -A OUTPUT -d $IPEXTERNO -s 0/0 -j ACCEPTiptables -A OUTPUT -d 0/0 -s $IPINTERNO -j ACCEPTiptables -A INPUT -i lo -j ACCEPTiptables -A FORWARD -s 0/0 -d $REDEINTERNA -j ACCEPT
#---------------- Bloqueio de máquinas --------------------------------##iptables -t filter -A INPUT -m mac --mac-source 00:00:27:64:00:95 -j DROP#iptables -t filter -A FORWARD -m mac --mac-source 08:00:27:64:00:95 -j DROP
![Page 54: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/54.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 54
Configuração do Servidor Apache(Servidor de Página Web)
![Page 55: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/55.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 55
Servidor de Páginas - Apache
/etc/apache2/apache2.conf
Porta padrão da aplicaçãoindex.html; index.php
Virtualização através de vhosts
![Page 56: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/56.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 56
FTP (File Transfer Protocol)( proftpd )
![Page 57: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/57.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 57
FTP (File Transfer Protocol)
apt-get isntall proftp
FTP ativo, tanto o cliente quanto o servidor tomam iniciativa de estabelecer uma das duas conexões.
FTP passivo é o cliente quem toma as duas iniciativas, haja vista o servidor permanecer PASSIVO.
O standalone é mais seguro e mais rápido, enquanto o inetd faz com que ele fique ativo apenas quando acessado, economizando cerca de 400 KB de memória RAM (que fazem pouca diferença hoje em dia). O modo standalone é a opção recomendada.
Arquivo de configuração:/etc/proftpd/proftpd.conf
Ativação/usr/sbin/proftpd
![Page 58: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/58.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 58
FTP (File Transfer Protocol)
# Port 21 is the standard FTP port.
Port 2121Ao mudar a porta padrão do servidor, os usuários precisarão indicar manualmente a porta no cliente de ftp ou navegador, como em: ftp://200.234.213.23:2100.
Em seguida vem a opção MaxInstances, que limita o número de conexões simultâneas do servidor FTP. Esta opção trabalha em conjunto com a limitação de banda (veja a seguir). Você pode limitar os downloads de cada usuário a um máximo de 10 KB/s e limitar o servidor a 3 usuários simultâneos. Assim, o FTP consumirá um máximo de 30 KB/s do link do servidor.
MaxInstances 30
Se você quiser limitar o acesso dos usuários a seus diretórios home, adicione a linha "DefaultRoot ~" no final do arquivo.
Lembre-se de que no Linux o "~" é um curinga, que é automaticamente substituído pela pasta home do usuário que está logado.
![Page 59: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/59.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 59
FTP (File Transfer Protocol)
Uma vez configurado o arquivo /etc/proftpd/proftpd.conf
Utilize o comando a seguir para testar se ele está ativado e aceitando conexão.
ps –ef | grep proftpd
A máquina cliente poderá ter acesso ao servidor via um software cliente, como:- Coreftp, FileZilla,...
- via navegador ftp://ip_do_servidor
- via prompt de comando: ftp ip_do_servidor
![Page 60: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/60.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 60
DHCP Dynamic Host Configuration Protocol
![Page 61: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/61.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 61
DHCP - Dynamic Host Configuration Protocol
apt-get install dhcp3-server
ddns-update-style none;subnet 192.168.1.0 netmask 255.255.255.0 { default-lease-time 600; max-lease-time 7200; option host-name "LAB-Minicurso"; range 192.168.1.11 192.168.1.254; option subnet-mask 255.255.255.0; option broadcast-address 192.168.1.255; option routers 192.198.1.1; option domain-name-servers 8.8.8.8, 8.8.4.4; option netbios-name-servers 192.168.1.1; authoritative;}host Mq01-Andreia-ETH {hardware ethernet 08:00:27:64:00:95; fixed-address 192.168.1.57; }
Arquivo de configuração:/etc/dhcp/dhcpd.conf
![Page 62: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/62.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 62
DHCP - Dynamic Host Configuration ProtocolPrincipais diretrizes do arquivo de configuração
default-lease-time 21600 – Servidores DHCP cedem endereços sob pedido por um tempo pré-determinado. O padrão nesse exemplo é ceder o endereço IP por 600 segundos, ou 10 minutos;
max-lease-time 7200 – Caso o cliente solicite um tempo maior, o tempo máximo permitido será de 7.200 segundos (2 horas);
option subnet-mask 255.255.255.0 – Essa opção define a máscara de subrede a ser fornecida aos clientes;
option broadcast-address 192.168.1.255 – Essa opção define o endereço de envio para requisições de broadcast;
option routers – 192.168.1.1 – O cliente além do número IP, recebe também a informação do número do host que é o gateway de sua rede;
option domain-name-servers - 8.8.8.8, 8.8.4.4 – Essa opção lista os servidores de nomes (DNS) a serem utilizados para resolução de nomes (mais de um servidor de DNS pode ser utilizado, desde que separado por vírgula;
option domain-name emc.local – O nome de domínio do cliente.
![Page 63: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/63.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 63
DHCP - Dynamic Host Configuration Protocol
Resultado esperado na máquina cliente
/usr/sbin/dhcpd eth1 startAtivação
Listening on LPF/eth1/08:00:27:51:99:bb/192.168.1.0/24Sending on LPF/eth1/08:00:27:51:99:bb/192.168.1.0/24Sending on Socket/fallback/fallback-netroot@ubuntu:/etc/dhcp# There's already a DHCP server running.
Resultado esperado após ativação no servidor - (algo similar):
![Page 64: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/64.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 64
DHCP - Dynamic Host Configuration Protocol
tail -f /var/lib/dhcp/dhcpd.leases
Arquivo contendo os logs das concessões dadas as máquinas que requisitaram o endereço IP e não estão cadastradas seu endereço MAC.
lease 192.168.1.232 { starts 1 2013/10/28 20:09:21; ends 2 2013/10/29 02:09:21; cltt 1 2013/10/28 20:09:21; binding state active; next binding state free; hardware ethernet 84:38:35:6d:03:7d; uid "\001\20485m\003}"; client-hostname "iPhonedeRicardo";}
Resultado do arquivo de log
![Page 65: Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Ubuntu Server e Windows Em Ambiente Virtualizado ( Instalação ) Prof. Fernando Legore](https://reader037.vdocuments.net/reader037/viewer/2022102814/552fc12a497959413d8ccd15/html5/thumbnails/65.jpg)
UENP / CCT / CLM - Redes I - Prof. Fernando Legore 65
Debian Sid (Aprígio Simões) http://www.aprigiosimoes.com.br/2013/04/08/debian-sid/
Calculadora IP - http://www.subnet-calculator.com/
http://www.pop-pb.rnp.br/ipv6.html
http://ipv6.br/habilitando-linux/
http://www.tunnelbroker.net/
GeoIP - http://whatismyipaddress.com/?gclid=CIfuq-rJt7oCFUkV7AodSj4AUw
http://www.cirp.usp.br/arqs/4ciclo/MaquinasVirtuais.pdf
http://www.professorramos.com/Packet-Tracer.php
Referências