Práctica 6 - Redes de Computadoras 2022-2#

Equipo-BASJ-MAMM-MELE-MOGJ#

  • Bautista Sandoval Juan Carlos 314275541
  • Martínez Mendoza Miguel Angel 314133225
  • Mendoza López Edgar Omar 308341209
  • Monter Gallardo Jessica 305116941

Creación de una máquina virtual en Azure#

Máquina Virtual

Configuración de la Zona DNS#

Creamos y configuramos una Zona DNS dentro de los servicios de Azure

Máquina Virtual

Para realizar esta sección de la práctica, hicimos uso de un dominio alojado en GoDaddy bigtown.com.mx

Creamos la configuración correspondiente para habilitar el subdominio

  • redes.bitgtown.com.mx

Agregamos los registros correspondientes a los DNS que Azure nos provee en nuestra zona, a la configuración del dominio en la cuenta de GoDaddy, estos registros son de tipo NS:

  • ns1-32.azure-dns.com.
  • ns2-32.azure-dns.net.
  • ns3-32.azure-dns.org.
  • ns4-32.azure-dns.info.
Registros NS

Verificación de configuración de la zona DNS y GoDaddy#

Configuración de la máquina virtual#

Configuracion de sudo

redes@Debian-Redes:~$ sudo -k
redes@Debian-Redes:~$ sudo -l
Matching Defaults entries for redes on Debian-Redes:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User redes may run the following commands on Debian-Redes:
    (ALL : ALL) ALL
    (ALL) NOPASSWD: ALL
redes@Debian-Redes:~$ sudo -i
_____________________________________________________________________
WARNING! Your environment specifies an invalid locale.
 The unknown environment variables are:
   LC_CTYPE=UTF-8 LC_ALL=
 This can affect your user experience significantly, including the
 ability to manage packages. You may install the locales by running:

 sudo dpkg-reconfigure locales

 and select the missing language. Alternatively, you can install the
 locales-all package:

 sudo apt-get install locales-all

To disable this message for all users, run:
   sudo touch /var/lib/cloud/instance/locale-check.skip
_____________________________________________________________________

root@Debian-Redes:~#
root@Debian-Redes:~# cat /etc/sudoers.d/waagent
cat: /etc/sudoers.d/waagent: No such file or directory

Configuración de llave SSH

ssh-keygen -t rsa -b 4096 -N "" -C "Equipo-BASJ-MAMM-MELE-MOGJ" -f ~/.ssh/equipo_redes_rsa

jessmonter@Jesss-MacBook-Air ~ % ls -la ~/.ssh/equipo_redes_rsa*
-rw-------  1 jessmonter  staff  3389 Jun  8 18:16 /Users/jessmonter/.ssh/equipo_redes_rsa
-rw-r--r--  1 jessmonter  staff   752 Jun  8 18:16 /Users/jessmonter/.ssh/equipo_redes_rsa.pub
jessmonter@Jesss-MacBook-Air ~ % cat ~/.ssh/equipo_redes_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCz8UFkT2uOizRroJbJZhp3vXAuIp1YPmTdNlNWC1DUOqEj5cjledYK7jF3mxSwBOaekQ+qBFJ7tJyPBttpjXUqpuhWRtVhfCAo0knIW5Fs83pPHFR0oF550nq36olcvQ+2JZhjmavT6fF3ObfM0fWQ5Ba8t7J0oSRJ6fz0yu6Uyr6vBT41lv86ummKXpShdFK85kswPrdDWf0NYUFzTDuBd/Ahp6Pq7sCVz7E3kN89BKiPxoik1c+vza5CyPpfe1c3YCVvzrvt7c925xq0/lFebC8wH765zD5UYrOoBK1ca2uc2wDCjQeS9agktXDQBefPRIpmYOYt7HHw5aKRuJtQbt7N4xp5rZBa+ae65FvtkUJ8+rAG/gdCvqGrvHZyp+ZjukEzLz77g5geNQ99ElUF1XIzs+3bIl6aKv+xVTAULqIUzHoaikEJvfki4w388HsxLvJ9JdJwQVkL5OwydhxmSX5qaOdZKEhOh1Ru2txGaERtxobj/N3CsqzxMOudaEacH0o4CxSw4e9j7HCX/tSVfm2moBXtim67aUixrfdQ8UllvgjkWqTRxoN4rFVrX9IqQFi0MKrdk1AzEavG5liSgNlEDLppKCCR39ZgqzWShHukAhcr6PNb3VmA8tNvRqiPda5QAfUGzdiXoRU1+rMm8NbgSrg6y7cPytaHDUH3Dw== Equipo-BASJ-MAMM-MELE-MOGJ


jessmonter@Jesss-MacBook-Air ~ % wc -l ~/.ssh/equipo_redes_rsa.pub
       1 /Users/jessmonter/.ssh/equipo_redes_rsa.pub

Configuración en

/Users/jessmonter/.ssh/config
Host 20.211.99.164 redes.bigtown.com.mx *.redes.bigtown.com.mx
  User redes
  IdentityFile ~/.ssh/equipo_redes_rsa

Que nos permite conectar a la máquina virtual ingresando únicamente

ssh redes.bigtown.com.mx

Así:

jessmonter@Jesss-MacBook-Air ~ % ssh redes.bigtown.com.mx
The authenticity of host 'redes.bigtown.com.mx (20.211.99.164)' can't be established.
ECDSA key fingerprint is SHA256:YcYmEiq9SLq4NZ4GhogdfetPlabDboSimaXqPVME5Zs.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'redes.bigtown.com.mx' (ECDSA) to the list of known hosts.
redes@redes.bigtown.com.mx's password:
Linux Debian-Redes 5.10.0-14-cloud-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Jun  8 23:11:54 2022 from 181.62.53.87
redes@Debian-Redes:~$ sudo -i
root@Debian-Redes:~#

Configuración del nombre de HOST#

root@Debian-Redes:~# hostnamectl set-hostname redes.bigtown.com.mx
root@Debian-Redes:~# hostname -f
redes.bigtown.com.mx
root@Debian-Redes:~# cat /etc/hosts
127.0.0.1   localhost
::1     localhost ip6-localhost ip6-loopback
ff02::1     ip6-allnodes
ff02::2     ip6-allrouters
20.211.99.164   redes.bigtown.com.mx
redes@redes:~$ hostname -f
redes.bigtown.com.mx
redes@redes:~$ hostnamectl status
   Static hostname: redes.bigtown.com.mx
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 244e03770d0342788f138b64f768fc88
           Boot ID: 5a696423ff864b94b408574d9dac90b1
    Virtualization: microsoft
  Operating System: Debian GNU/Linux 11 (bullseye)
            Kernel: Linux 5.10.0-14-cloud-amd64
      Architecture: x86-64

Configuración de Zona Horaria#

redes@redes:~$ date
Wed Jun  8 23:29:44 UTC 2022

redes@redes:~$ sudo -i
root@redes:~# timedatectl set-timezone America/Mexico_City
root@redes:~# date
Wed Jun  8 18:30:15 CDT 2022

root@redes:~# timedatectl
               Local time: Wed 2022-06-08 18:30:57 CDT
           Universal time: Wed 2022-06-08 23:30:57 UTC
                 RTC time: Wed 2022-06-08 23:30:58
                Time zone: America/Mexico_City (CDT, -0500)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Configuración de idioma#

Localización

Autenticación SSH en la máquina virtual#

jessmonter@Jesss-MacBook-Air Downloads % scp profesores_redes_rsa.pub redes@redes.bigtown.com.mx:/tmp/profesores_redes_rsa.pub
redes@redes.bigtown.com.mx's password:
profesores_redes_rsa.pub                                          100%  748     2.4KB/s   00:00
redes@redes:~$ test -d ~/.ssh || mkdir -vp ~/.ssh
redes@redes:~$ chmod 0700 ~/.ssh
redes@redes:~$ install --owner redes --group redes --mode 0600 /tmp/profesores_redes_rsa.pub ~/.ssh/authorized_keys2
redes@redes:~$ sudo -i
root@redes:~# test -d ~/.ssh || mkdir -vp ~/.ssh
root@redes:~# install --owner root --group root --mode 0600 /tmp/profesores_redes_rsa.pub ~/.ssh/authorized_keys2
root@redes:~# chattr +i ~redes/.ssh/authorized_keys2 ~root/.ssh/authorized_keys2
root@redes:~# ls -la ~root/.ssh ~redes/.ssh
/home/redes/.ssh:
total 12
drwx------ 2 redes redes 4096 Jun  8 18:41 .
drwxr-xr-x 3 redes redes 4096 Jun  8 18:27 ..
-rw------- 1 redes redes    0 May 25 13:07 authorized_keys
-rw------- 1 redes redes  748 Jun  8 18:41 authorized_keys2

/root/.ssh:
total 12
drwx------ 2 root root 4096 Jun  8 18:41 .
drwx------ 4 root root 4096 Jun  8 18:25 ..
-rw------- 1 root root    0 May 25 13:07 authorized_keys
-rw------- 1 root root  748 Jun  8 18:41 authorized_keys2
root@redes:~# lsattr ~root/.ssh/authorized_keys* ~redes/.ssh/authorized_keys*
--------------e------- /root/.ssh/authorized_keys
----i---------e------- /root/.ssh/authorized_keys2
--------------e------- /home/redes/.ssh/authorized_keys
----i---------e------- /home/redes/.ssh/authorized_keys2

root@redes:~# rm -v /tmp/profesores_redes_rsa.pub
removed '/tmp/profesores_redes_rsa.pub'

Configuración inicial de la máquina virtual#

root@redes:~# apt -q update
Hit:1 http://debian-archive.trafficmanager.net/debian bullseye InRelease
Hit:2 http://debian-archive.trafficmanager.net/debian-security bullseye-security InRelease
Get:3 http://debian-archive.trafficmanager.net/debian bullseye-updates InRelease [39.4 kB]
Get:4 http://debian-archive.trafficmanager.net/debian bullseye-backports InRelease [44.2 kB]
Get:5 http://debian-archive.trafficmanager.net/debian bullseye-backports/main Sources.diff/Index [63.3 kB]
Get:6 http://debian-archive.trafficmanager.net/debian bullseye-backports/main amd64 Packages.diff/Index [63.3 kB]
Get:7 http://debian-archive.trafficmanager.net/debian bullseye-backports/main Sources T-2022-06-08-2011.20-F-2022-06-08-2011.20.pdiff [4576 B]
Get:7 http://debian-archive.trafficmanager.net/debian bullseye-backports/main Sources T-2022-06-08-2011.20-F-2022-06-08-2011.20.pdiff [4576 B]
Get:8 http://debian-archive.trafficmanager.net/debian bullseye-backports/main amd64 Packages T-2022-06-08-2011.20-F-2022-06-08-2011.20.pdiff [204 B]
Get:8 http://debian-archive.trafficmanager.net/debian bullseye-backports/main amd64 Packages T-2022-06-08-2011.20-F-2022-06-08-2011.20.pdiff [204 B]
Fetched 215 kB in 1s (396 kB/s)
Reading package lists...
Building dependency tree...
Reading state information...
All packages are up to date.
root@redes:~# apt list --upgradable
Listing... Done

root@redes:~# apt -qy upgrade
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Carpeta files y archivos de bitacora#

Archivos de configuración#

Archivos contenidos en el directorio /etc/sudoers.d#

Archivos de bitácora#

Archivos contenidos en el directorio /var/log/apt#

Archivos contenidos en el directorio /var/log/azure#

Archivos contenidos en el directorio /var/log/unattended-upgrades#

Archivos contenidos en el directorio /var/lib/dhcp#

Archivos contenidos en el directorio /var/lib/cloud#