Imprimir Centos
Imprimir Centos
Imprimir Centos
19:/descargas19/mejia /home #scp -r root@10.10.21.19:/descargas19/ /home -------------------Para Instalar #vim /etc/yum.conf proxy=http://10.32.1.2:8080 esc :wq #yum -y install samba --------------------------------SAMBA (LINUX A WINDOWS) #setup (desabilitar cortafuegos) #rpm -q samba samba-client samba-common #vim /etc/samba/smb.conf [Global Settings] workgroup = LAB_A14 server string = SISTEMAS OPERATIVOS LINUX netbios name = localhost esc :wq #testparm COMPARTIR UNA CARPETA Y Q HAYA RED Y HACERLE PING A LA MAQUINA DE WINDOWS #ping 10.10.25.80 #smbclient //10.10.25.80/linux1 -U administrator smb: \> ls smb: \> exit (WINDOWS A LINUX) #vim /etc/samba/smb.conf [Share Definitions] [homes] comment = Home Directories browseable = no writable = yes [compartido] comment = Esta compartido en linux browseable = yes writable = yes path = /home/invitado1 create mode = 0777 [printers] comment = All Printers path = /var/spool/samba browseable = no guest ok = no writable = no printable = yes esc :wq
#testparm #useradd invitado1 #passwd invitado1 #smbpasswd -a invitado1 #service smb restart #setup #ping 10.10.25.45 ---------------------------------------------APACHE #rpm -q httpd (1 pagina) #vim /etc/httpd/conf/httpd.conf [MAIN SERVER] ServerName www.antisa.com:80 DocumentRoot "/var/www/html" esc :wq #vim /etc/hosts 10.10.21.19 www.antisa.com localhost esc :wq #cd /var/www/html #vim index.html Mi primera pagina esc :wq #service httpd restart Browser: www.antisa.com (2 a mas paginas) #vim /etc/httpd/conf/httpd.conf [VIRTUAL HOST] NameVirtualHost 10.10.21.19:80 <VirtualHost 10.10.21.19:80> ServerName www.web1.com DocumentRoot "/var/www/html/web1" </virtualhost> <VirtualHost 10.10.21.19:80> ServerName www.web2.com DocumentRoot "/var/www/html/web2" </virtualhost> esc :wq #vim /etc/hosts 10.10.21.19 www.web1.com localhost 10.10.21.19 www.web2.com localhost #cd /var/www/html #mkdir /var/www/html/web1 #mkdir /var/www/html/web2 #cd /var/www/html/web1 #vim index1.html #cd /var/www/html/web2 #vim index2.html #service httpd restart
Browser: www.web1.com www.web2.com ---------------------------------------------JOOMLA #rpm q httpd mysql mysql-server php-mysql phpcli php-common php-gd php-mbstring #vim /etc/httpd/conf/httpd.conf [VIRTUAL HOST] NameVirtualHost 10.10.21.19:80 <VirtualHost 10.10.21.19:80> ServerName www.joomla.com DocumentRoot "/var/www/html/web1" </virtualhost> esc :wq #vim /etc/hosts 10.10.21.19 www.joomla.com localhost #cd /var/www/html #mkdir /var/www/html/web1 #service httpd restart #cd /media/ANTISA/ #cp /media/ANTISA/Joomla_1...tar.gz /var/www/html/web1 #cd /var/www/html/web1 #tar -xzvf Joomla_1...tar.gz http://www.joomla.com #chmod -R 777 /var/www/html/web1 #service mysqld restart #mysql -u root mysql> set password for 'root'@'localhost'=password('123456'); mysql> exit #mysql -u root p mysql> grant all on joomla.* to 'admin1'@'localhost' identified by '123456' with grant option; mysql> flush privileges; http://www.joomla.com #rm -fr /var/www/html/web1/installation/ --------------------------------------------------------DRUPAL #rpm q httpd mysql mysql-server php-mysql phpcli php-common php-gd php-mbstring #vim /etc/httpd/conf/httpd.conf [VIRTUAL HOST] NameVirtualHost 10.10.21.19:80 <VirtualHost 10.10.21.19:80> ServerName www.drupal.com DocumentRoot "/var/www/html/web2" </virtualhost> esc :wq
#vim /etc/hosts 10.10.21.19 www.drupal.com localhost #cd /var/www/html #mkdir /var/www/html/web2 #service httpd restart #cd /media/ANTISA/ #cp /media/ANTISA/drupal-6.22.tar.gz /var/www/html/web2 #cd /var/www/html/web2 #tar -xzvf drupal-6.22.tar.gz --strip-components=1 #service mysqld restart http://www.drupal.com #chown -R root /var/www/html/web2 #chown -R apache /var/www/html/web2 **chgrp -R apache /var/www/html/web2 #cp ./sites/default/default.settings.php ./sites/default/settings.php #chgrp -R apache . #chgrp -R apache ./sites/default/ **chown -R apache ./sites/default #chgrp -R root ./sites/default/ #chmod -R g+w ./sites/default/ **chmod -R g+w sites/default http://www.drupal.com #service mysqld restart #mysql -u root mysql> create database drupal; mysql> grant all on drupal.* to 'admin2'@'localhost' identified by '123456' with grant option; mysql> flush privileges; mysql> exit #service mysqld restart http://www.drupal.com -------------------------------------------DNS #rpm -q bind bind-utils bind-libs bind-chroot caching-nameserver #vim named.conf #cp named.conf /var/named/chroot/etc #cp 23.10.10.in-addr-arpa.zone /var/named/chroot/var/named #cp practicalinux1.com.zone /var/named/chroot/var/named #cd /var/named/chroot/var/named/ #mv practicalinux1.com.zone profesorlinux.com.zone #vim profesorlinux.com.zone $TTL 86400 @ IN SOA @ root ( 42; Numero de Serie #
2880; Tiempo de Refresco 7200; Tiempo de Reintentos 604800; Expiracion 86400; Tiempo Total de Vida ) IN NS @ profesorlinux.com. IN MX 10 mail.profesorlinux.com. profesorlinux.com. IN A 10.10.21.15 mail IN A 10.10.21.15 #mv 23.10.10.in-addr-arpa.zone 21.10.10.inaddr.arpa.zone #service named restart #cd /var/named/chroot/etc #vim named.conf zone "profesorlinux.com" { type master; file "profesorlinux.com.zone"; allow-update { none; }; }; zone "21.10.10.in-addr.arpa" { type master; file "21.10.10.in-addr.arpa.zone"; allow-update { none; }; }; #service named restart #host profesorlinux.com 10.10.21.15 #dig @10.10.21.15 profesorlinux.com #dig @10.10.21.15 profesorlinux.com MX nslookup >www.profesorlinux.com -----------------------------------------------NFS #rpm -q nfs-utils rpcbind #rpm -q pormap --es en centos 5.4 #ps ax | grep nfs #ps ax | grep mountd #service nfs restart #ps ax | grep nfs #ps ax | grep mountd #cd /etc/ #ls expor* #vim exports /nfs/descargas *(ro,rw) Esc :wq #service nfs restart(ERROR) #mkdir -p var/nfs/descargas #service nfs restart #showmount -e 10.10.25.10-->mi ip #setup(FIREWALL) #showmount -e 10.10.25.22-->otra ip #mount -t nfs 10.10.25.22:/nfs/descargas/ /nfs/descargas/
--------------------------------FTP #rpm -q vsftpd #cd /etc/vsftpd #ls #vim vsftpd.conf anonymous_enable=NO/12 local_enable=YES/15 local_umask=644/22 anon_upload_enable=YES/27 anon_mkdir_write_enable=NO/31 ftpd_banner=Welcome/85 chroot_list_enable=YES/96 chroot_list_file=/etc/vsftpd/chroot_list/98 #setup #vim chroot_list gerente1 Esc :wq #useradd gerente1 #passwd gerente1 #service vsftpd restart #cd #cd /home/gerente1 #cat > ejemplo1 HOLA Esc :wq (TERMINAL) #ftp 10.10.21.21 ftp> bye o quit (MODO GRAFICO) Privacidad/Limpiar los datos->poner check a todo ftp://10.10.21.11 --------------------------------------------------------SEND MAIL #rpm -q sendmail dovecot cyrus-sasl-md5 cyrussasl-plain mc m4 #cd /etc/mail #ls #vim access *by default we allow relaying from localhost... Connect:localhost.localdomain RELAY Connect:localhost RELAY Connect:127.0.0.1 RELAY *este es mi ip personal-->COMENTARIO connect:10.10.21.21 RELAY #vim local-host-names dominiocorreo.com #vim relay-domains dominiocorreo.com #vim sendmail.mc
DAEMON_OPTIONS(`Port=smtp,Addr=10.10.21.21 , Name=MTA')dnl /117 dnl #FEATURE(`accept_unresolvable_domains')dnl /150 LOCAL_DOMAIN(`dominiocorreo.com')dnl /158(157) MASQUERADE_AS('dominiocorreo.com'dnl /162 Quitamos el dnl en las lneas 44-52-53-164-168 Agregamos dnl # lnea 39 #vim /etc/dovecot.conf protocols = imap pop3 /20 #useradd usuario1 #passwd usuario1 #saslpasswd2 nombreDelsuario #service sendmail restart #service dovecot restart #service saslauthd restart #yum -y install squirrelmail httpd #cd /usr/share/squirrelmail/config/ #./conf.pl http://127.0.0.1/webmail/ -------------------------------------------PROGRAMAS EN SHELL #vim programa1 echo "Ingresa tu nombre:" read a echo "Tu nombre es" $a sleep 3 ---PAUSAR TRES SEGUNDOS echo "Gracias.." Esc :wq #chmod 777 programa1 #./programa1 (**) Ingresa tu nombre: Daniel Tu nombre es Daniel Gracias.. (**) #vim programa2 echo "comprobacion de archivos activos" service httpd restart service smb restart service sshd restart echo "haciendo pin a la pc del gerente" ping 10.10.25.10 echo "estado de init" ps as | greap -i init echo "fecha actual" date sleep 5 echo "se produce a limpiar la Pantalla"
clear echo "rutina terminada" sleep 1 echo "." sleep 1 echo "." :wq #cd #sh programa2 ctrl +c --------------------------------------------IPTABLES #iptables -A INPUT -i eth0 -j ACCEPT #iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT #iptables -A INPUT -p icmp -j REJECT #iptables nl --- BORAR LAS REGLAS PASADAS #iptables -F #iptables -X #iptables -Z #iptables nL #iptables -P INPUT ACCEPT #iptables -P OUTPUT ACCEPT #iptables -P FORWARD ACCEPT #iptables -P INPUT -i lo -j ACCEPT #iptables -A INPUT -i lo -j ACCEPT #iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT #iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT #iptables -A INPUT -i eth0 -p tcp --dport 1:1024 -j reject #iptables -A INPUT -i eth0 -p tcp --dport 1:1024 -j REJECT #iptables -A INPUT -i eth0 -p tcp --dport 1:1024 -j REJECT #iptables -nL ------------------------------------# scp -r root@10.10.21.55:/root/dns /root/ # scp -r root@10.10.25.45:/root/clase* /root/Escritorio/