::agustin@valgoma.net::

README


* Para recuperar el MBR en windows:

fdisk /mbr

* Cómo configurar las estaciones de trabajo en la oficina para usar los 
  /home de forma compartida. Como configurar la estación como cliente NIS.
El procedimiento es: 
  vi /etc/rc.config 
  cambiar: 
    YP_DOMAINNAME="efaber1yp" 
    CREATE_YP_CONF="yes" 
    YP_SERVER="192.168.1.1" 
    START_YPBIND="yes" 
  ejecutar: /sbin/SuSEconfig 
  probarlo: 
    /etc/rc.d/init.d/ypclient start 
    ypcat passwd

También para usar el mapa hosts: 
    vi /etc/nsswitch.conf 
    linea 34: cambiar a: "hosts: files nis dns"

Para configurar el uso de los homes compartidos en el servidor en cada estación
hay que hacer lo siguiente: 
    Borrar _todos_ los usuarios locales! 
    En /etc/fstab añadir una linea nueva:
    server:/home /home nfs defaults 1 2 
    mount /home 
    Ahora con YAST crear usuario local con nombre de tipo svetl o agustinl 
    (i.e. con un "l" al final). Este usuario tine que tener UID _por debajo de 
    600_ y su home tiene que estar en /home2
En principio eso es todo. Ahora los homes están en el servidor y, por lo tanto, 
no hay que usarlos para ficheros bajados de Internet y otras cosas poco 
importantes. Para experimentos hay que usar /home2. Así, por ejemplo, el cache 
de Netscape no tiene porque estar en el servidor y hay que ponerlo en un 
directorio local (se cambia de Edit->Preferencies->Advanced->Cache).

Para cambiar el password via NIS se usa yppasswd 

* Configurar IP Masquarading
Utilidad: /sbin/SuSEfirewall
Ficheros: /etc/rc.d/firewall y /etc/rc.config.d/firewall.rc.config


- NFS Image: If you want to install over a network, you need to mount the Red
Hat Linux CD-ROM on a machine that supports ISO-9660 filesystems with Rock
Ridge extensions. The machine must also support NFS. Export the CD-ROM 
filesystem via NFS. You should either have nameservices configured or know
the NFS server's IP address and the path to the exported CD-ROM.

- The image for a network installation is bootnet.img (not boot.img):

dd if=bootnet.img of=/dev/fd0 bs=1440k

_____________________________________________________________________________

*** NIS: Network Information Service ***

NIS is a generic client/server database system. The most common use for it is
sharing password and group files across a network. NIS was originally known as
The Yellow Pages, or YP for short.

Files as /etc/passwd and /etc/group are not host specific and require frequent
updating. NIS enables you to set up a master server where these files are
stored and a client consults the NIS server when needed. A file to be 
shareable via NIS must be a straight text file with a entry unique (either the 
login or UID) across the file. The files are converted into DBM files,
passwd.byname and passwd.byuid.

Installation: the packages are yp-tools-2.1-1, ypbind-3.3-9 and ypserv.

_____________________________________________________________________________

*** NFS: Network Filesystem ***

NFS is the means by which UNIX systems share their disk resources. Three
programs provide NFS server services: rpc.portmapper, rpc.nfsd, rpc.mountd.

To check these programs: rpcinfo -p, rpcinfo -p hostname

To start, stop and state the NFS daemons: /etc/rc.d/init.d/nfs start,
/etc/rc.d/init.d/nfs stop and /etc/rc.d/init.d/nfs status. 

The two key files to NFS are /etc/exports on the server side and /etc/fstab
on the client side. The exports file specifies which directories are to be
shared with which client's access rights. The fstab file specifies which
servers to contact for certain directories, as well as where to place them in
the directory tree.
Whenever you change /etc/exports or /etc/fstab the NFS daemons must be 
stopped and restarted.

Example of /etc/exports file:
/etc            lcpxdj.wm.lc.ehu.es(ro,no_root_squash)
/usr/local      lcpxdj.wm.lc.ehu.es(ro,no_root_squash)
/home           lcpxdj.wm.lc.ehu.es(ro,no_root_squash), ravel
/home           hipatia(ro,no_root_squash)
/mnt/cdrom      lisitea(ro,no_root_squash)
/home/agustin   lisitea(rw,no_root_squash)

Example of /etc/fstab file:
/dev/hda1               /                       ext2    defaults        1 1
/dev/hda3               /usr                    ext2    defaults        1 2
/dev/hda4               /data                   ext2    defaults        1 2
/dev/hda2               swap                    swap    defaults        0 0
/dev/fd0                /mnt/floppy             ext2    noauto          0 0
none                    /proc                   proc    defaults        0 0
titan:/mnt/cdrom        /home/agustin/cdrom     nfs     ro,bg           0 0
titan:/home/agustin     /home/agustin/titan     nfs     rw,bg           0 0

To mount and umount an exported filesystem:
mount servername:/exported/dir /dir/to/mount, umount /dir/to/mount
Evidently, /dir/to/mount must be created before mounting.
If you need to remount a large number of filesystems that are already listed
in the fstab file, you can use the -a option in mount to remount all the 
entries in fstab: mount -a.

More information: Red Hat Linux 6 Unleashed.
_____________________________________________________________________________

*** Mounting a remote filesystem using NFS ***

The best and the most elegant way to read and write your mounted via NFS files 
on a remote host from a local host is via NIS (see above). However, you can 
play a nasty game to do the same: you should set the same UID and GID in all 
your files and directories in both, the remote and the local hosts. In other 
case, only when you are the root user can read and write the files. This trick 
is only valid when you have to maintaing a couple of hosts and a couple of 
accounts. If it is not a job as easy, and you have hundreds of users and tens 
of host to maintain, the obvious solution is NIS. 
(Note: I have still a problem with ssh when I do this.)

_____________________________________________________________________________

*** Vocabulary ***

OpenSSL (Secure Socket Library).

Turing Machine = computer program (algorithm).
Universal Turing Machine = the computer on which different programs can be run.

Internet Gateways =aprox= IP routers.
Supernetting = using bitmasks to create networks larger that the natural masks.

TCP/IP = Application Layer (Telnet,FTP,SMTP,HTTP,DNS,NFS...).
         Host To host Transport Layer.
         Internet Layer.
         Network Access Layer.

user ID (UID) = the unique number that identifies a user to the operating
                system.
group ID (GID) = the unique number that identifies a user's group.

DNS Server = The Domain Name System is basically a database of host information.
The structure of the DNS database is very similar to the structure of the UNIX 
filesystem. Programs called name servers constitute the server half of DNS's 
client-server mechanism. Name servers contain information about some segment of
the database and make it available to clients, called resolvers. Resolvers are 
often just library routines that create queries and send them across a network 
to a name server.
 
DNS Client = Resolvers are the clients that access name servers. Programs 
running on a host that need information from the domain name space use the 
resolver. The resolver handles:
*Querying a name server.
*Interpreting responses.
*Returning the information to the programs that requested it.
In BIND (Berkeley Internet Name Domain), the resolver is just a set of library 
routines that is linked into programs such as telnet and ftp. It's not even a 
separate process. It has the smarts to put together a query, to send it and 
wait for an answer, and to resend the query if it isn't answered, but that's 
about all. Most of the burden of finding an answer to the query is placed on 
the name server. 
(BIND is by far the most popular implementation of DNS today).

Gateways/Router = If the Destination Address is the address of a host on the 
local network, the packet is delivered directly to the destination. If the 
Destination Address is not on the local network, the packet is passed to a 
gateway for delivery. Gateways are devices that switch packets between the 
different physical networks. Deciding which gateway to use is called routing. 
IP makes the routing decision for each individual packet.
Internet gateways are commonly (and perhaps more accurately) referred to as IP 
routers because they use Internet Protocol to route packets between networks. 
In traditional TCP/IP jargon, there are only two types of network devices 
- gateways and hosts. Gateways forward packets between networks, and hosts 
don't. However, if a host is connected to more than one network (called a 
multi-homed host), it can forward packets between the networks. When a 
multi-homed host forwards packets, it acts just like any other gateway and is 
considered to be a gateway. Current data communications terminology makes a
distinction between gateways and routers, [4] but we'll use the terms gateway 
and IP router interchangeably.
    [4] In current terminology, a gateway moves data between different 
    protocols and a router moves data between different networks. So a system 
    that moves mail between TCP/IP and OSI is a gateway, but a traditional IP 
    gateway is a router.

This is why is so important to set a host's netmask correctly -it's the parameter
that tells the host whether to send the packet either directly to the destination
host or to the router.

_____________________________________________________________________________

"gbak -B database database.backup" (mirar gbak -h para ayuda) es el programa que
me permite hacer backup a la base de datos interbase.

_____________________________________________________________________________

pilot-mail (mirar "pilot-mail -h").

_____________________________________________________________________________

nmap (xnmap): programa excelente para mapear la red.
portmap: NFS, NIS.
netstat
cat /proc/mdstat
ntsysv (tksysv): simple interface for configuring runlevels.

_____________________________________________________________________________

**Unix Web Application Architectures**

Application Servers: Allaire's Cold Fusion, IBM WebSphere or the
                     OpenSource product Zope.

Code Embedded in HTML: the OpenSource product PHP, and Active Server Pages (ASP).

mod_perl: The Apache module mod_perl allows running the perl interpreter as part 
          of Apache processes. 

_____________________________________________________________________________

La forma de cambiar el tamaño de history a, por ejemplo, 3000 entradas es:
export HISTSIZE=3000

_____________________________________________________________________________

issue e issue.net contienen los mensajes de bienvenida al sistema. 

_____________________________________________________________________________

La forma de montar una imagen (CD-ROM en este caso) es la siguiente:
mount -o loop -t iso9660 file.img /dir/for/mounted/image

_____________________________________________________________________________

pstree es un comando interesante.

_____________________________________________________________________________

*** PGP ***
Para añadir a mis keyrings:        pgp -ka keyfile

Para ver el fingerprint:           pgp -kvc userid

Para ver el contenido del
public key ring:                   pgp -kv (pgp -kvv)

Para obtener la llave del
keyring:                           pgp -kxa userid

Para encriptar:                    pgp -e Mensaje userid

Para desencriptar:                 pgp Mensaje.pgp

Para firmar y certificar el
public key de otro:                pgp -ks su_mi_userid -u mi_userid

Para firmar con mi secret key:     pgp -sta Mensaje -u agustin

Para comprobar una firma:          pgp -o newplaintext ciphertext

Para incluir pgp en el pine hay que añadir lo siguiete en .pinerc:

# This variable takes a list of programs that message text is piped into
# after MIME decoding, prior to display.
display-filters=_BEGINNING("-----BEGIN PGP MESSAGE-----")_ /usr/bin/pgp
# This defines a program that message text is piped into before MIME
# encoding, prior to sending
sending-filters=/usr/bin/pgp -esaf _RECIPIENTS_

_____________________________________________________________________________

*** LDAP - Lightweight Directory Access Protocol ***
(http://www.openldap.org/doc/admin/)

LDAP daemon, slapd(8) 
LDAP update replication daemon, slurpd(8)
LDAP configuration file, slapd.conf(5)

1. INTRODUCTION TO OpenLDAP DIRECTORY SERVICES

-What is a directory service?
A directory is specialized database optimized for reading, browsing and searching.
The Internet Domain Name System is an example of a globally distributed directory 
service.
-What is LDAP?
slapd's model for directory service is based on a global directory model called 
LDAP. LDAP is a directory access protocol that runs over TCP/IP. 
The LDAP information model is based on entries. An entry is a collection of 
attributes that has a globally-unique Distinguished Name (DN).
In LDAP, directory entries are arranged in a hierarchical tree-like structure.
LDAP allows you to control which attributes are required and allowed in an entry 
through the use of a special attribute called objectClass.
An entry is referenced by its distinguished name, which is constructed by taking 
their name of the entry itself (called the Relative Distinguished Name or RDN) and 
concatenating the names of its ancestor entries.
The LDAP search operation allows some portion of the directory to be searched for 
entries that match some criteria specified by a search filter.
LDAP also supports privacy and integrity security services.
-How does LDAP work?
LDAP directory service is based on a client-server model.
One or more LDAP servers contain the data making up the LDAP directory tree.
An LDAP client connects to an LDAP server and asks it a question. 
-What is slapd and what can it do?
slapd is an LDAP directory server. slapd supports Unicode and language tags.
slapd can be configured to maintain replica copies of its database.
-What about X.500?
Technically, LDAP is a directory access protocol to an X.500 directory service, the 
OSI directory service.
-What is slurpd and what can it do?
slurpd(8) is a daemon that helps slapd provide replicated service. It is responsible
for distributing changes made to the master slapd database out to the various slapd 
replicas.
It frees slapd from having to worry that some replicas might be down or unreachable 
when a change comes through; slurpd handles retrying failed requests automatically.
slapd and slurpd communicate through a simple text file that is used to log changes.

2. A QUICK-START GUIDE (ldap 1.2.11)

-look at http://www.openldap.org/doc/admin/quickstart.html
(error in documentation: in ldapsearch and ldapadd, option -x must be changed by 
option -v, i.e., verbose) 

-Usually installed at /usr/local/etc/openldap/*
-Provided slapd.conf(5) (usually installed at /usr/local/etc/openldap/slapd.conf)
-You can use ldapadd(1) to add entries to your LDAP directory. ldapadd expects input 
in LDIF form. We'll do it in two steps: 1.create an LDIF file, 2.run ldapadd
Ej:(to search and to add into ldbm) 
ldapsearch -v -b 'dc=lcpxew,dc=wm,dc=lc,dc=ehu,dc=es' '(objectclass=*)'
ldapadd -v -D "cn=Manager, dc=lcpxew, dc=wm, dc=lc, dc=ehu, dc=es" -W -f example.ldif

3. THE BIG PICTURE - CONFIGURATION CHOICES

-Local Directory Service
-Local Directory Service with Referrals
-Replicated Directory Service
-Distributed Local Directory Service

4. BUILDING AND INSTALLING OpenLDAP SOFTWARE

-Look at 2 and at http://www.openldap.org/doc/admin/install.html

5. THE slapd CONFIGURATION FILE

-Look at 2 and at http://www.openldap.org/doc/admin/slapdconfig.html 

6. RUNNING slapd

-Starting slapd: /usr/local/etc/libexec/slapd [