Saturday, 22 October 2016

cd /etc/sysconfig/network-scripts/ = Para llegar a esta carpeta
ls = archivos disponibles
vi ifcfg-eth0 (para entrar a modificar el archivo)

DEVICE=eth0
BOOTPROTO=static
IPADDR=10.0.6.17
NETMASK=255.255.255.0
GATEWAY=10.0.6.1
DNS1=192.168.1.160
HWADDR=XXXX
ONBOOT=yes



:w guardar
:q quit

Ya le asigné la ip estática (Foto 1 y 2)

service network restart (Reiniciar las tarjetas de red)

Desactivar el cortafuego:

Bajar el servicio IPTable
chkconfig iptables off
service iptables stop

- Desactivar el cortafuegos en el windows, probar con un ping a la IP del centos, y desde Centos a Windows.

CTRL + c = para la máquina

Servicio de Print Service:
cd /etc/init.d/

Servicios Cups (servicio que trabaja a nivel de WebService. Todos los documentos las guarda en la máquina, y trabaja a nivel de browser). Por defecto usa el puerto 631, y por defecto el 80.

- Service cups
- Service cups status
En un navegador: http://localhost:631/admin

65.565 puertos por IP (Para la prueba)

----------------------

service httpd status
service httpp start

vi /etc/httpd/conf/httpd.conf

Cambio el ServerName

- service httpd restart

init (comando para reiniciar la configuración del sistema operativo)
init 1 se apaga
init 6 se reinicia


--------

cd /var/www/html/

touch index.html (crear el archivo windows)
ls Lo muestra creado
vi index.html (modifica el archivo)

service httpd restart

(INICIO,OPCIONES DE INTERNET,CONEXIONES, CONF LAN, OPC AVANZADAS, EXCEPCIONES)


Puntos:

1 Crear directorio "Administración" en /root con su usuario
chmod 777 /root

mkdir (crear directorio)


3. Crear Script que respalde directorio "administracion" en /var/www

RESP: Entro a la carpeta. Creo el archivo touch script01.sh
vi script01.sh
mv (mover), cp(copiar), rm (remove)

En el archvio
#! /bin/bash
cp-R web origen (cp es copiar y -R es que copie todo el paquete) (/root/administracion) web destino (/var/www/)

4. Crear impresora llamada "Santo Tomas"
5. Programar el script a las 21.00 horas todos los días 5 de cada mes

Con Crontab = crond 
cat /etc/crontab = ayuda muestra sintaxis de ejecución

crontab-l = listo toda la programacion que tengo a nivel de usuario
crontab -e = para crear uno nuevo

***** user accion
(minuto,hora,dia,mes,dia semana)
30 3 6 * * pablovega (opcional) /root/administracion/script.sh (o puede ser una acción como un cp, mv, o ifconfig)


6. Levantar un sitio web en Apache con un saludo.




7. Activar servicio SSH y acceder por Putty

ssh (viene instalado, hay que validar si está activo o no)

putty (putty.org)


$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$4
Asignar IP a la máquina en Centos:
1. Llegar a la carpeta
cd /etc/sysconfig/network-scripts/ 

2. ls (Listar archivos disponibles)
2.1 -ls -l (lista en detalle)

3. Entrar a modificar el archivo (vi=entrar; i=editar)
vi ifcfg-eth0

4. Debe quedar así:
DEVICE=eth0
BOOTPROTO=static
IPADDR= 10.0.6.17 
NETMASK=255.255.255.0
GATEWAY=10.0.6.1
DNS1=192.168.1.160
HWADDR=XXXX
ONBOOT=yes

5. Guardar configuración y salir
:w Guardar (write)
:q Salir (quit)

6. Reiniciar las tarjetas de red
+ service network restart

7. Desactivar el cortafuego en Windows y agregar IP en excepciones

8. Bajar el servicio ipTable
chkconfig iptables off
service iptables stop

**************************
a) Crear usuarios
+ adduser NOMBRE
+ passwd NOMBRE
**************************
b) Cambiar de usuarios
+ su NombreDeUsuario
**************************
c) Saber el nombre del host
+ hostname
**************************
d) Ver el estado de la tarjeta de red
+ service network status
**************************
e) Reiniciar tarjeta de red
+ service network restart
**************************
f) Hacer conversar las máquinas
+ ifconfig
+ Chequear que esté en modo puente 
+ service network restart
+ service iptables stop (se apaga el cortafuego)
+ service iptables status (ver estado del cortafuego)
+ Desactivar el Firewall en W7, agregar la IP en excepciones
+ Probar con un Ping de Centos a W7 y viceversa.
(Ctrl+C=Frenar la máquina tras el PING)
**************************
g) Crear directorios
+ mkdir NOMBRE (Crea directorio)
+ touch NOMBRE (Crea archivo)
+ cat NOMBRE (Visualizar el archivo)

--Permisos--
r=4 lectura
w=2 escritura
x=1 ejecución

+ chmod [_ _ _ ] NOMBRE.txt
ejemplo: chmod 777 /root/ (con root, para dar acceso full a directorio root)

*************************
Levantar página en Apache
a) entrar al directorio cd /etc/httpd/conf/
b) entrar al archivo httpd.conf
c) modificar el server name por localhost (ojo, descomentar)
d) service httpd restart
e) entrar al directorio cd /var/www/html/
f) crear el archivo index.html (touch)
g) modificar el archivo index.html (vi)
e) service httpd restart
f) revisar.

************************
# respaldo de /usr/archivos
# se forma el nombre del archivo
DIA=`date +%d`
MES=`date +%m`
AÑO=`date +%Y`
HORA=`date +%H`
ARCHIVO=respaldo$AÑO$MES$DIA_$HORA00.tar.gz
# copia del archivo
tar xvzf /usr/archivos/* /respaldos/$ARCHIVO

***********************
CRONTAB
+ service crond restart
+ crontab -e

* * * * /ruta y extension/
min hora dia mes diaSEM

PERMISO DE EJECUCION EL ARCHIVO

No comments:

Post a Comment