Instalacion LTSP en mastin.champinet.es

Joan Torrents Pareja

reboot@escomposlinux.org


Tabla de contenidos
1. Objetivo
2. Sistema Base
3. Paquetes instalados
4. Configuración
5. ¿ Funciona ?
6. Entorno Kiosk Mode
6.1. Gestion de permisos de el entorno de usuario
7. Licencia
8. Creditos y Agradecimientos

1. Objetivo

Montaje de un sistema publico (kiosk mode) con menus personalizados (o sea ninguno), el entorno esta orientado fundamentalmente a la navegación por InterNet.

La característica fundamental es que los equipos tienen una configuración particular y unos requerimientos extras de seguridad para que sólo puedan ser utilizados con estos objetivos.

El arranque remoto de los clientes se realiza vía red local mediante un disco-ROM (floppy o cdrom) el cual carga los datos necesarios en memoria.


2. Sistema Base

El sistema base es:


3. Paquetes instalados

Paquetes especificos de woody instalados:

ademas de las dependencias de los mismos

Paquetes instalados, para bajarlos ir a: http://www.ltsp.org/documentation/instruction-3.0-es.htm

Importante

El primero en instalarse debe ser ltsp-core-i386_3.0.7-3_all.deb

El siguiente lo he generado yo desde un rpm: xsri_2.1.0-6_i386.deb

El original se bajo desde: ftp://rpmfind.net/linux/redhat/9/en/os/i386/RedHat/RPMS/xsri-2.1.0-5.i386.rpm

Para las estaciones de trabajo: BootRom para arrancar desde floppy generada para una rtl8029 (ne2k-pci) desde: http://www.rom-o-matic.net/5.0.9/ luego:

dd if=eb-5.0.9-rtl8029.lzdsk of=/dev/fd0

4. Configuración

En esta parte solo comento la parte de los ficheros que he cambiado para no hacer este documento excesivamente largo.

/etc/inetd.conf

tftp  dgram  udp  wait  nobody  /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot

Comprobar que el fichero /etc/hosts.allow contiene las siguientes lineas:

bootpd:    0.0.0.0
in.tftpd:  192.168.0.
portmap:   192.168.0.
mountd:    192.168.0.

Editar el fichero /opt/ltsp/i386/etc/lts.conf para adecuarlo a nuestras caracteristicas, en mi caso ha quedado asi:

[Default]
  SERVER             = 192.168.0.4
  XSERVER            = auto
  X_MOUSE_PROTOCOL   = "PS/2"
  X_MOUSE_DEVICE     = "/dev/psaux"
  X_MOUSE_RESOLUTION = 400
  X_MOUSE_BUTTONS    = 3
  USE_XFS            = N
  LOCAL_APPS         = N
  RUNLEVEL           = 5
  DNS_SERVER         = 192.168.0.3
  SEARCH_DOMAIN      = "champinet.es"

# Estaciones de trabajo

[ws001]
  XSERVER            = auto
  LOCAL_APPS         = N
  USE_NFS_SWAP       = N
  SWAPFILE_SIZE      = 64m
  X_MOUSE_PROTOCOL   = "Microsoft"
  X_MOUSE_DEVICE     = "/dev/ttyS0"
# Monitor VGA antiguo
  X_MODE_1  = 800x600  40   800  840  968  1056 600 601 605 628 +hsync +vsync
  X_MODE_0  = 640x480 31.5 640  664  704  832  480489 492 520 +hsync +vsync
  RUNLEVEL           = 5

[ws002]
  XSERVER            = XF86_SVGA
  LOCAL_APPS         = N
  USE_NFS_SWAP       = N
  SWAPFILE_SIZE      = 64m
  X_MOUSE_PROTOCOL   = "Microsoft"
  X_MODE_0           = 800x600
  X_MOUSE_DEVICE     = "/dev/ttyS0"
  RUNLEVEL           = 5

Importante

Antes de generar las plantillas con el comando "ltsp_initialize" mantener comentadas las lineas correspondientes a las estaciones de trabajo

Importante

¡¡¡MUY IMPORTANTE SIN ESTO NO TENDREMOS TECLADO ESPAÑOL!!!

El fichero /opt/ltsp/i386/etc/rc.setupx3 sirve para generar el XF86Config de la estacion cliente que esten basados en servidores X version 3.3.6 del tipo XF86_*, para los que estan soportados por la version 4 de las X se utiliza elfichero /opt/ltsp/i386/etc/rc.setupx, tenemos que editar las siguientes lineas para disponer de los teclados en español.

/opt/ltsp/i386/etc/rc.setupx Seccion"Setup Keyboard and Mouse info":

Option      "XkbLayout" "${XkbLayout:-"us"}"

cambiar por:

Option      "XkbLayout" "${XkbLayout:-"es"}"

/opt/ltsp/i386/etc/rc.setupx3 Seccion "Setup Keyboard and Mouse info":

XkbLayout=`  get_cfg XkbLayout   "us"`

cambiar por:

XkbLayout=`  get_cfg XkbLayout   "es"`

/opt/ltsp/templates/create-templates/CONFIG

IP_NETWORK_BASE=192.168.0
IP_NETWORK=${IP_NETWORK_BASE}.0
IP_SERVER=${IP_NETWORK_BASE}.4
IP_BROADCAST=${IP_NETWORK_BASE}.255
IP_NETMASK=255.255.255.0

En este punto ejecuta /opt/ltsp/templates/ltsp_initialize, tengo que decir que acepte todos los cambios propuestos por defecto, en todo caso lo mejor es revisarlos posteriormente.

Al acabar la ejecucion de este comando entre otras cosas nos ha generado un fichero "dhcpd.conf" de ejemplo, al final a mi me ha quedado asi:

/etc/dhcpd.conf

default-lease-time            21600;
max-lease-time                21600;

option subnet-mask            255.255.255.0;
option broadcast-address      192.168.0.255;
option routers                192.168.0.3;
option domain-name-servers    192.168.0.3;
option domain-name            "champinet.es";
option root-path              "192.168.0.4:/opt/ltsp/i386";

shared-network WORKSTATIONS {
    subnet 192.168.0.0 netmask 255.255.255.0 {
    range 192.168.0.22 192.168.0.30;
    }
}

group   {
    use-host-decl-names       on;
    option log-servers        192.168.0.4;
# The following is _NOT_ a MAC address!
    option option-128         e4:45:74:68:00:00;

host ws001 {
        hardware ethernet     00:20:18:38:2c:6e;
        fixed-address         192.168.0.20;
        filename              "/tftpboot/lts/vmlinuz-2.4.19-ltsp-1";
        #option option-129     "NIC=eepro100";
    }
    host ws002 {
        hardware ethernet     00:40:33:57:c3:9b;
        fixed-address         192.168.0.21;
        filename              "/tftpboot/lts/vmlinuz-2.4.19-ltsp-1";
        #option option-129     "NIC=tulip";
    }
}
# Fijaros que las estaciones con "fixed-address" estan fuera del rango asignable de IP's

Tenemos que habilitar el login remoto mediante XDMCP en el fichero /etc/X11/xdm/Xaccess

*       #any host can get a login window

Gestor de ventanas

Yo he elegido Window Maker (http://www.windowmaker.org/) de Alfredo Kojima por ser un entorno ligero

Hasta aquí deberiamos tener un entorno LTSP funcional completamente.


5. ¿ Funciona ?

Veamos que nos dice un tail -f /var/log/syslog

Apr 27 14:29:06 mastin dhcpd-2.2.x: DHCPDISCOVER from 00:40:33:57:c3:9b via eth0
Apr 27 14:29:06 mastin dhcpd-2.2.x: DHCPOFFER on 192.168.0.21 to 00:40:33:57:c3:9b via eth0
Apr 27 14:29:06 mastin dhcpd-2.2.x: DHCPREQUEST for 192.168.0.21 from 00:40:33:57:c3:9b via eth0
Apr 27 14:29:06 mastin dhcpd-2.2.x: DHCPACK on 192.168.0.21 to 00:40:33:57:c3:9b via eth0
Apr 27 14:29:06 mastin in.tftpd[1079]: connect from 192.168.0.21
Apr 27 14:29:06 mastin tftpd[1080]: tftpd: trying to get file: /tftpboot/lts/vmlinuz-2.4.19-ltsp-1
Apr 27 14:29:10 mastin dhcpd-2.2.x: DHCPDISCOVER from 00:40:33:57:c3:9b via eth0
Apr 27 14:29:10 mastin dhcpd-2.2.x: DHCPOFFER on 192.168.0.21 to 00:40:33:57:c3:9b via eth0
Apr 27 14:29:12 mastin dhcpd-2.2.x: DHCPREQUEST for 192.168.0.21 from 00:40:33:57:c3:9b via eth0
Apr 27 14:29:12 mastin dhcpd-2.2.x: DHCPACK on 192.168.0.21 to 00:40:33:57:c3:9b via eth0
Apr 27 14:29:12 mastin rpc.mountd: authenticated mount request from ws002.champinet.es:688 for /opt/ltsp/i386 (/opt/ltsp/i386)
Apr 27 14:29:20 ws002 syslogd started: BusyBox v0.60.1 (2001.09.28-01:12+0000)
Apr 27 14:29:21 ws002 devfsd[108]: Caught SIGHUP
Apr 27 14:29:21 ws002 devfsd[108]: read config file: "/etc/devfsd.conf"
Apr 27 14:29:21 ws002 init: Entering runlevel: 2
Apr 27 14:29:21 ws002 init: Switching to runlevel: 5

6. Entorno Kiosk Mode

A partir de aqui se explica como crear un entorno de kiosk mode con el objetivo de que el cliente solo disponga de una sesion de konqueror abierta, por lo tanto _NO_ dispondra de:


6.1. Gestion de permisos de el entorno de usuario

Los usuarios creados expresamente para utilizar el modo kiosko tendran una shell restrigida, para ello utilizaremos /bin/rbash

Añadir el usuario de forma normal con:

adduser --shell /bin/rbash ws003

El primer arranque del nuevo usuario debe ser con KDE, editar el /home/ws003/.xsession y comentar todas las lineas excepto la de arranque del KDE:

exec startkde

cerrar la sesion sin hacer nada mas despues de haber arrancado KDE

Volver a editar el archivo /home/ws003/.xsession y: comentar la linea:

exec startkde

descomentar las lineas:

exec kfmclient openProfile kiosko &
exec wmaker

Volver a entrar con el usuario ws003 y ya estara activado el modo kiosko

Modificamos algunos permisos y ficheros de configuración del $HOME/ws003

Muestra de un ls -ls del usuario ws003.

DIOS@mastin/root> cd /home/
DIOS@mastin/home> ll
[......]
 drwxr-xr-x    8 ws003    ws003        4096 abr 21 13:00 ws003
DIOS@mastin/home> cd ws003
DIOS@mastin/home/ws003> ll -a
total 92
drwxr-xr-x    8 ws003    ws003        4096 abr 21 13:00 .
drwxrwsr-x   11 root     staff        4096 abr 19 04:16 ..
-rw-------    1 ws003    ws003        1118 abr 21 01:24 .bash_history
-rw-r--r--    1 ws003    ws003         174 abr 19 04:16 .bash_logout
-rw-r--r--    1 ws003    ws003         604 abr 19 04:16 .bash_profile
-rw-r--r--    1 ws003    ws003        1123 abr 19 04:16 .bashrc
drwx------    3 ws003    ws003        4096 abr 20 01:50 Desktop
drwxr-sr-x    6 ws003    ws003        4096 abr 19 04:16 GNUstep
-rw-r--r--    1 ws003    ws003        1135 abr 20 01:41 .gtkrc-kde
-rw-------    1 ws003    ws003           0 abr 21 12:57 .ICEauthority
drwx------    4 ws003    ws003        4096 abr 19 04:21 .kde
-rw-------    1 ws003    ws003         154 abr 19 04:16 .kderc
drwxr-sr-x    3 ws003    ws003        4096 abr 19 04:16 .mcop
-rw-------    1 ws003    ws003          31 abr 20 01:41 .mcoprc
drwxr-sr-x    2 ws003    ws003        4096 abr 19 04:16 public_html
drwxr-sr-x    2 ws003    ws003        4096 abr 19 04:16 .qt
-rw-------    1 ws003    ws003        4729 abr 20 16:53 .viminfo
-rw-------    1 ws003    ws003           0 abr 21 12:56 .Xauthority
-rwxr-xr-x    1 ws003    ws003         431 abr 20 15:06 .xsession
-rw-------    1 ws003    ws003       17824 abr 21 12:57 .xsession-errors
DIOS@mastin/home/ws003> ll .kde/share/config/
total 184
-rw-r--r--    1 root     root           47 abr 19 04:16 artsmessagerc
-rw-r--r--    1 root     root         1442 abr 19 04:16 cryptodefaults
-rw-r--r--    1 root     root           41 abr 19 04:16 dummy
-rw-r--r--    1 root     root           32 abr 19 04:16 kab2kabcrc
-rw-r--r--    1 root     root          502 abr 19 04:16 katepartrc
-rw-r--r--    1 root     root         8804 abr 19 04:16 katesyntaxhighlightingrc
-rw-r--r--    1 root     root          229 abr 19 04:16 kcmcssrc
-rw-r--r--    1 root     root           73 abr 19 04:16 kcmdisplayrc
-rw-r--r--    1 root     root            0 abr 20 01:41 kcminitrc
-rw-r--r--    1 root     root            0 abr 19 04:16 kcminputrc
-rw-r--r--    1 root     root          335 abr 19 04:16 kcmnspluginrc
-rw-r--r--    1 root     root          150 abr 20 16:50 kcmshellrc
-rw-r--r--    1 root     root         1285 abr 19 04:16 kconf_updaterc
-rw-r--r--    1 root     root          146 abr 19 04:16 kcontrolrc
-rw-r--r--    1 root     root          217 abr 19 04:16 kcookiejarrc
-rw-r--r--    1 root     root         5819 abr 21 01:11 kdeglobals
-rw-r--r--    1 root     root           83 abr 19 04:16 kdeprintrc
-rw-r--r--    1 root     root          792 abr 20 22:18 kdesktoprc
-rw-r--r--    1 root     root           38 abr 19 04:16 kfmclientrc
-rw-r--r--    1 root     root         1107 abr 19 04:16 kickerrc
-rw-r--r--    1 root     root           38 abr 19 04:16 kinfocenterrc
-rw-r--r--    1 root     root          151 abr 19 04:16 kio_httprc
-rw-r--r--    1 root     root          206 abr 19 04:16 kioslaverc
-rw-r--r--    1 root     root           32 abr 19 04:16 klaunchrc
-rw-r--r--    1 root     root            0 abr 20 01:42 klipperrc
-rw-r--r--    1 root     root           59 abr 19 04:16 kmail.eventsrc
-rw-r--r--    1 root     root          232 abr 19 04:16 kmailrc
-rw-r--r--    1 root     root           55 abr 19 04:16 knewstickerappletrc
-rw-r--r--    1 root     root           67 abr 19 04:16 knewsticker_appletrc
-rw-r--r--    1 root     root          490 abr 20 14:33 konq_history
-rw-r--r--    1 root     root           20 abr 19 04:16 konqiconviewrc
-rw-r--r--    1 root     root           40 abr 19 04:16 konqsidebartng.rc
-rw-r--r--    1 root     root         1854 abr 21 01:23 konquerorrc
-rw-r--r--    1 root     root           96 abr 19 04:16 konsolerc
-rw-r--r--    1 root     root          157 abr 19 04:16 kpersonalizerrc
-rw-r--r--    1 root     root           97 abr 19 04:16 kpgprc
-rw-r--r--    1 root     root          344 abr 20 01:50 ksmserverrc
-rw-r--r--    1 root     root           28 abr 19 04:16 ktiprc
-rw-r--r--    1 root     root           44 abr 19 04:16 kuriikwsfilterrc
-rw-r--r--    1 root     root          534 abr 19 04:16 kwin.eventsrc
-rw-r--r--    1 root     root           94 abr 19 04:16 kwinkeramikrc
-rw-r--r--    1 root     root          431 abr 20 01:50 kwinrc
-rw-r--r--    1 root     root          223 abr 19 04:16 kwriterc
-rw-r--r--    1 root     root          171 abr 19 04:16 kxkbrc
drwxr-s---    2 ws003    ws003        4096 abr 20 01:50 session
-rw-r--r--    1 root     root           25 abr 19 04:16 uiserverrc
DIOS@mastin/home/ws003> ll .kde/share/apps/konqueror/
total 28
-rw-r--r--    1 root     root           24 abr 19 04:16 bookmarks.xml
-rw-r--r--    1 root     root            0 abr 19 04:16 bookmarks.xml.tbcache
-rw-r--r--    1 root     root         3754 abr 20 21:37 konq_history
-rw-r--r--    1 root     root         2024 abr 21 00:32 konqueror.rc
drwxr-xr-x    2 root     root         4096 abr 19 04:16 profiles
-rw-r--r--    1 root     root         4810 abr 20 16:24 seg-konqueror.rc
drwxr-xr-x    2 root     root         4096 abr 20 21:54 seg-profiles
DIOS@mastin/home/ws003> ll .kde/share/apps/konqueror/profiles/
total 20
-rw-r--r--    1 root     root          820 abr 19 04:16 filemanagement
-rw-r--r--    1 root     root          820 abr 19 04:16 filepreview
-rw-r--r--    1 root     root          820 abr 19 04:16 kiosko
-rw-r--r--    1 root     root          820 abr 19 04:16 midnightcommander
-rw-r--r--    1 root     root          820 abr 19 04:16 webbrowsing
DIOS@mastin/home/ws003>

Contenido del fichero profile/home/ws003/.kde/share/apps/konqueror/profiles/kiosko

DIOS@mastin/home/ws003> cat .kde/share/apps/konqueror/profiles/kiosko

[Main Window Settings]
MenuBar=Disabled

[Main Window Settings Toolbar bookmarkToolBar]
Hidden=true
IconSize=22
IconText=IconTextRight
Index=3
NewLine=true
Offset=-1
Position=Top

[Main Window Settings Toolbar extraToolBar]
Hidden=true
IconSize=22
IconText=IconOnly
Index=0
NewLine=false
Offset=-1
Position=Top

[Main Window Settings Toolbar locationToolBar]
Hidden=true
IconSize=22
IconText=IconOnly
Index=2
NewLine=true
Offset=-1
Position=Top

[Main Window Settings Toolbar mainToolBar]
Hidden=false
IconSize=22
IconText=IconOnly
Index=1
NewLine=true
Offset=-1
Position=Top

[Profile]
Name=kiosko
RootItem=View0
View0_LinkedView=false
View0_LockedLocation=false
View0_PassiveMode=false
View0_ServiceName=khtml
View0_ServiceType=text/html
View0_ToggleView=false
View0_URL=http://www.google.com/
View0_docContainer=true

7. Licencia

Copyright (c) 2003 Joan Torrents Pareja

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

Full license text at http://www.gnu.org/licenses/fdl.html#TOC4


8. Creditos y Agradecimientos

A mi familia por su paciencia

A Ignacio García (aka Mainake) por sus conocimientos de docbook

A Sinner (aka Sinner) por darme una base de partida