Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Grupo 4
Integrantes:
Script:
#!/bin/bash
function uno(){
function dos(){
ifconfig
route
}
function tres(){
function cuatro(){
read pagina
ping -c 10 $pagina
function cinco(){
tcpdump -c 10 -i enp0s3
function seis(){
more /var/log/messages
function siete(){
init 6
function ocho(){
init 0
function nueve(){
break
function Menu(){
read opcion
case $opcion in
1) clear;uno;;
2) clear;dos;;
3) clear;tres;;
4) clear;cuatro;;
5) clear;cinco;;
7) clear;siete;;
8) clear;ocho;;
9) clear;nueve;;
esac
while true;
do
Menu
Done
Ejecución:
Script: Menu con opciones para la administracion de un servidor linux
1. Interfaces
2. Cambio de IP WAM
3. Usuarios
4. Ping
5. Sniffer
7. Reiniciar
8. Apagar
9. Salir
1)enp0s3
2)inet6
3)ether 52
root
bin
daemon
adm
lp
sync
shutdown
halt
operator
games
ftp
nobody
systemd-bus-proxy
systemd-network
dbus
polkitd
abrt
unbound
tss
libstoragemgmt
rpc
colord
usbmuxd
saslauth
geoclue
rtkit
radvd
rpcuser
nfsnobody
qemu
chrony
setroubleshoot
pulse
gdm
gnome-initial-setup
sshd
avahi
postfix
ntp
tcpdump
pafecede
google.com
Actividad 2
Desarrolle un script para reiniciar el servidor y que se ejecute a través de una tarea
programada el primer día de cada mes a las 23h59. Sugerencia: Servicio crond en el
archivo /etc/crontab.
Script:
#!/bin/bash
reboot
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,$
#| | | | |
# * * * * * user-name command to be executed
59 23 1 * * /bin/reiniciar
Actividad 3
Desarrolle un script para agregar una ruta y almacenarla en el archivo /etc/rc.local, y
que se ejecute a través de una tarea programada los días 15 de manera trimestral a las
09h20. Sugerencia: Servicio crond en el archivo /etc/crontab
Script:
#!/bin/bash