SysRescCD presentation
Feb 04, 08 by Juan Lebrijo about backup, blog, LAN
As an alternative in free software for Norton Ghost, or DriveImage/PartitionMagic (PowerQuest before, Norton nowadays), we have SysRescCD. It is a CD to rescue the systemsfrom a big disease. We are interested in the following features:
  • Backup network system (LAN) to create images from all the system periodically. Partimaged.
  • Partition managed partitions: create, delete, resize,... Gparted
We are going to develop the use of this tool in various articles. How to create a simple LAN backup for a little server or home PC. Not only used for linux partitions (ext3), for other systems as NTFS or FAT too. We download an ISO image which will be burn in a CD. To read my sources, here I keep my usual reference table: Origin http://www.sysresccd.org/Main_Page Repository http://www.sysresccd.org/Download Package 0.3.2 Documentation (spanish) http://www.sysresccd.org/Online-Manual-ESGENTOO:http://www.gentoo.org/doc/es/handbook/handbook-x86.xml Documentation (english) http://www.sysresccd.org/Online-Manual-EN
Apagando un Windows desde Linux
Jan 28, 08 by Juan Lebrijo about blog, SAI, LAN
Queremos que nuestro NUT mande una orden de apagado cuando no haya corriente y se acabe la batería. Pero podría ser útil apagando los ordenadores automaticamente los ordenadores en un Ciberteca, aula de ordenadores, …. Para ello tenemos que instalar un servidor SSH en Negro (WinXP). Y generar clave simétrica RSA para conectarnos de forma automática y segura. Instalamos freeSSHd (http://freesshd.com), que es un servidor ssh libre para windows, basado en OpenSSH.
  • Lo instalamos como servicio para que se inicie al iniciar el sistema.
  • Creamos al usuario ups que se valida por Public Key:
En la máquina servidor upsd creamos las claves y sus permisos (que solo pueda ) para mayor seguridad:
elite:~# ssh-keygen -t rsa -q -f /etc/nut/rsa_upsEnter passphrase (empty for no passphrase):

Enter same passphrase again:

elite:~# chmod 600 /etc/nut/rsa_up*
Copiamos el fichero público (rsa_ups.pub) a C:\Archivos de programa\freeSSHd\: Renombrando rsa_ups.pub con el nombre de usuario: C:\Archivos de programa\freeSSHd\ups Ya debería responder el PC Windows al comando (utilizando la clave privada):
ssh -i /etc/nut/rsa_ups ups@negro.lebrijo.com “shutdown -s -f -t 60″
Para nuestro NUT hacemos lo siguiente:
  • Creamos el batch con las órdenes de apagado apagado_sistema.sh:
#!/bin/sh# Apagamos el PC de escritorio (si estuviera encendido)ssh -i /etc/nut/rsa_ups ups@negro.lebrijo.com “shutdown -s –f”

# Apagamos el servidor elite

/sbin/shutdown -h +0
  • Cambiamos los permisos, para que se ejecute el script:
chmod 744 /etc/nut/*.sh
Shuting down a Windows system from a Linux one
Jan 28, 08 by Juan Lebrijo about blog, SAI, LAN
We want that our NUT sends a shutdown order when there is not suply and the battery goes down. But it could be useful too to shut down a Cybertheque computers, computer classroom, …. For this we must install a SSH server in Negro (WinXP). And generate a simetric RSA key for connecting automatically and secure. We will install freeSSHd (http://freesshd.com), it is a free ssh server for windows, based on OpenSSH.
  • We will install as a service in order to start when the system boots.
  • Create an ups user who login with Public Key:
In the server upsd machine create the keys and their permissions (read and write only the root) for better security:
elite:~# ssh-keygen -t rsa -q -f /etc/nut/rsa_ups
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
elite:~# chmod 600 /etc/nut/rsa_up*
Copy the public file (rsa_ups.pub) to C:\Archivos de programa\freeSSHd\: Renaming rsa_ups.pub with the user name: C:\Archivos de programa\freeSSHd\ups Now Windows PC must accept tothe command (using the private key):
ssh -i /etc/nut/rsa_ups ups@negro.lebrijo.com “shutdown -s -f -t 60″
In our NUT we will do:
  • Create the script with shutdown orders apagado_sistema.sh:
#!/bin/sh
# Shutting down the desctop computer (if it will be up)

ssh -i /etc/nut/rsa_ups ups@negro.lebrijo.com “shutdown -s –f”

# Shutting down the server

/sbin/shutdown -h +0
  • Change the permissions, to execute the script:
chmod 744 /etc/nut/*.sh