Diferencia entre revisiones de «Configurar servidor desde cero»
De Wiki de BandaAncha.eu
m («Configurar servidor desde cero» protegido: Vandalismo excesivo ([edit=autoconfirmed] (caduca el 05:15 22 ago 2009 (UTC)) [move=autoconfirmed] (caduca el 05:15 22 ago 2009 (UTC)))) |
|||
(No se muestran 24 ediciones intermedias de 12 usuarios) | |||
Línea 1: | Línea 1: | ||
+ | {| class="wikitable" align="right" cellpadding="4" | ||
+ | |+ '''Sobre este documento''' | ||
+ | |- | ||
+ | | bgcolor="#ddf"|'''Tipo''' || Manual (How To) | ||
+ | |- | ||
+ | | bgcolor="#ddf"|'''Categoria''' || [[:Categoría:Linux|Linux]] | ||
+ | |- | ||
+ | | bgcolor="#ddf"|'''Plataforma''' || RedHat Linux | ||
+ | |- | ||
+ | | bgcolor="#ddf"|'''Dificultad''' || [[Imagen:Micro_tux.png|Tux]][[Imagen:Micro_tux.png|Tux]] | ||
+ | |- | ||
+ | |} | ||
==SSH== | ==SSH== | ||
− | |||
− | |||
Creo mi usuario | Creo mi usuario | ||
Línea 14: | Línea 24: | ||
vi .ssh/authorized_keys # pego la clave pública y guardo | vi .ssh/authorized_keys # pego la clave pública y guardo | ||
− | == | + | Edito la config del sshd |
+ | |||
+ | vi /etc/ssh/sshd_config | ||
+ | |||
+ | y añado | ||
+ | |||
+ | AllowUsers root nombre_usuario | ||
+ | Compression yes | ||
+ | LoginGraceTime 15 # reduce el tiempo para poner el pass | ||
+ | #PasswordAuthentication no # desactiva el login con pass (cuidado) | ||
+ | #Port otro_puerto # evita curiosos | ||
+ | #ListenAddress 172.24.138.62 # solo escucha en IP principal | ||
+ | Protocol 2 # solo permitimos ssh2 | ||
+ | |||
+ | reiniciamos sshd | ||
+ | |||
+ | service sshd restart | ||
+ | |||
+ | ==Yum== | ||
+ | |||
+ | Actualizamos paquetes | ||
− | + | yum update | |
==Locate== | ==Locate== | ||
Línea 23: | Línea 53: | ||
updatedb | updatedb | ||
− | |||
− | |||
==Cambiar hostname== | ==Cambiar hostname== |
Revisión actual del 07:15 22 may 2009
Tipo | Manual (How To) |
Categoria | Linux |
Plataforma | RedHat Linux |
Dificultad | ![]() ![]() |
Contenido
SSH[editar]
Creo mi usuario
useradd nombre_usuario passwd nombre_usuario # cambio pass
Genero el par de claves en mi equipo, que quedan almacenadas en ~/.shh como id_rsa (privada) e id_rsa.pub (pública)
cd /nombre_usuario mkdir .ssh vi .ssh/authorized_keys # pego la clave pública y guardo
Edito la config del sshd
vi /etc/ssh/sshd_config
y añado
AllowUsers root nombre_usuario Compression yes LoginGraceTime 15 # reduce el tiempo para poner el pass #PasswordAuthentication no # desactiva el login con pass (cuidado) #Port otro_puerto # evita curiosos #ListenAddress 172.24.138.62 # solo escucha en IP principal Protocol 2 # solo permitimos ssh2
reiniciamos sshd
service sshd restart
Yum[editar]
Actualizamos paquetes
yum update
Locate[editar]
vi vi /etc/updatedb.conf # pongo DAILY_UPDATE=yes para que actualice la db una vez al día updatedb
Cambiar hostname[editar]
vi /etc/hosts # levitico.vectrice.com vi /etc/sysconfig/network # HOSTNAME=levitico.vectrice.com # reiniciamos shutdown -r now # comprobamos uname -a
NTP[editar]
yum install ntp crontab -e # añadimos 17 3,15 * * * /usr/sbin/ntpdate swisstime.ethz.ch 1>/dev/null
Cambiar password de root[editar]
passwd root
Grub[editar]
vi /boot/grub/menu.lst # modificamos timeout=2 para reducir el tiempo de espera del menú en el arranque
Consolas virtuales[editar]
Reduzco su número a 3
vi /etc/inittab
y comento las siguientes líneas
#4:2345:respawn:/sbin/mingetty tty4 #5:2345:respawn:/sbin/mingetty tty5 #6:2345:respawn:/sbin/mingetty tty6
Deshabilitar SELinux[editar]
vi /etc/selinux/config
y ponemos
SELINUX=disabled
Deshabilitando servicios[editar]
[root@levitico ~]# chkconfig --list | grep 3:on pcmcia 0:off 1:off 2:on 3:on 4:on 5:on 6:off rpcgssd 0:off 1:off 2:off 3:on 4:on 5:on 6:off netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off isdn 0:off 1:off 2:on 3:on 4:on 5:on 6:off cyrus-imapd 0:off 1:off 2:on 3:on 4:on 5:on 6:off kudzu 0:off 1:off 2:off 3:on 4:on 5:on 6:off mydns 0:off 1:off 2:off 3:on 4:on 5:on 6:off syslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off haldaemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off cpuspeed 0:off 1:on 2:on 3:on 4:on 5:on 6:off mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off httpd 0:off 1:off 2:off 3:on 4:on 5:on 6:off atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off smartd 0:off 1:off 2:on 3:on 4:on 5:on 6:off anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off xinetd 0:off 1:off 2:off 3:on 4:on 5:on 6:off cups 0:off 1:off 2:on 3:on 4:on 5:on 6:off portmap 0:off 1:off 2:off 3:on 4:on 5:on 6:off rpcidmapd 0:off 1:off 2:off 3:on 4:on 5:on 6:off gpm 0:off 1:off 2:on 3:on 4:on 5:on 6:off irqbalance 0:off 1:off 2:off 3:on 4:on 5:on 6:off messagebus 0:off 1:off 2:off 3:on 4:on 5:on 6:off openibd 0:off 1:off 2:on 3:on 4:on 5:on 6:off apmd 0:off 1:off 2:on 3:on 4:on 5:on 6:off autofs 0:off 1:off 2:off 3:on 4:on 5:on 6:off acpid 0:off 1:off 2:off 3:on 4:on 5:on 6:off network 0:off 1:off 2:on 3:on 4:on 5:on 6:off sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off nfslock 0:off 1:off 2:off 3:on 4:on 5:on 6:off microcode_ctl 0:off 1:off 2:on 3:on 4:on 5:on 6:off iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off rawdevices 0:off 1:off 2:off 3:on 4:on 5:on 6:off
# Common Unix Printing System service cups stop chkconfig --del cups # automounts service autofs stop chkconfig --del autofs # converts RPC program numbers into DARPA protocol port numbers. It must be running in order to make RPC calls service portmap stop chkconfig --del portmap # Network File System Daemons service rpcidmapd stop chkconfig --del rpcidmapd service nfslock stop chkconfig --del nfslock service rpcgssd stop chkconfig --del rpcgssd # Mounts/Unmounts all Network File Systems service netfs stop chkconfig --del netfs