Mostrando entradas con la etiqueta Solaris. Mostrar todas las entradas
Mostrando entradas con la etiqueta Solaris. Mostrar todas las entradas

lunes, 2 de junio de 2014

Solaris.Como saber si nuestro kernel corre en 64 o 32 bits

Solaris
isainfo -kv
output :
bash-3.00# isainfo -kv
64-bit amd64 kernel modules


Linux
Uname -m
output :
[root@cacti01 ~]# uname -m
x86_64

Solaris.Flushear caché DNS

Generalmente no realizamos esta tarea en Solaris , salvo cuando hacemos modificaciones en los servidores dns con equipos que tenían otros nombres en el server , es decir , si había un servidor  llamado fileserver.miempresa.com , registrado con la ip 192.168.250.100 y cambiamos de servidor de archivos pero no queremos cambiar el nombre , entonces registramos el mismo nombre fileserver.miempresa.com  , pero con la ip 192.168.250.110 .
En solaris y otros unix , necesitamos flushear manualmente el caché de todos los equipos que no lo realizan automaticamente (Windows, por ej , lo hace cada 3 dias ) , por lo que debemos aguardar que expire el TTL (time to live) del mismo .
En caso que pensemos que esperar este tiempo no sea prudente , debemos trabajar con el demonio NSCD , presente en Solaris y otros Unix , además de varios S.O con Linux . Este demonio mantiene el sistema de caché , incluidos , por supuesto y en este caso , el DNS/Wins caché.

Todo lo que necesitamos para flushear el caché DNS es reiniciar el demonio NSCD de la forma siguiente :

Encontramos el numero de proceso (PID) del demonio NSCD :
# ps -ef | grep nscd

Matamos el proceso con el comando pkill o kill :
#pkill <PID>
#kill <PID>


Controlamos que el demonio ya no este corriendo :
# ps -ef | grep nscd

Y volvemos a levantarlo :
#/usr/sbin/nscd

Con este pequeño procedimiento deberíamos reiniciar el demonio que maneja el caché dns de nuestro servidor Solaris .

jueves, 18 de julio de 2013

Solaris.Agregar rutas estaticas persistentes

Enrutando el trafico hacia un host por otra interfaz que no sea el gateway por defecto : 

route -p add 192.168.168.110 70.26.244.10

Con esto indicamos que para llegar al host 192.168.168.110 debemos salir por la interfaz que tiene configurada la ip 70.26.244.10 ; donde la opcion -p indica que se trata de una ruta persistente , es decir , que la misma se mantendra luego de reiniciar el equipo

Si queremos agregar la ruta hacia una red en particular lo hacemos asi :

route add net 192.168.1.0 10.10.10.1 
En la cual indicamos que para llegar a la red 192.168.1.0/24 (Toma la configuracion de la mascara de acuerdo a la clase de red que sea , si es privada y de clase C , como este caso, tendra una mascara /24 , es decir 255.255.255.0 ) vaya por el GW 10.10.10.1 . En este caso , si reiniciamos el equipo la ruta agregada desaparecera de la tabla de ruteo (la podemos ver con netstat -rn) , entonces , si queremos evitar esto agregamos la opcion -p (persistent) , quedando de esta forma :

route -p add net 192.168.1.0 10.10.10.1


miércoles, 19 de junio de 2013

Solaris.Saber cuanta memoria fisica tenemos instalada en el servidor

Si queremos saber con cuanta memoria fisica corremos nuestro solaris lo hacemos de la siguiente manera :
# /usr/sbin/prtconf | grep Mem
Memory size: 10240 Megabytes

Nota : Deben asegurarse de escribir Mem y no mem , como es case sensitive del modo incorrecto no desplegara informacion alguna.

En publicaciones posteriores analizaremos las estadisticas de uso de memoria con el programa sar .

jueves, 15 de noviembre de 2012

Cambiar la IP de una Zona en Solaris

Para cambiar la ip de una zona en solaris lo hacemos de la siguiente manera :

bash-3.2#zonecfg -z zonename
select net address=x.x.x.x (IP actual)
set address=y.y.y.y (Nueva IP junto con la mascara en CIDR)
end
verify
commit
exit

No es necesario el reinicio de la zona , basta con probar el acceso por ssh para comprobar los cambios . 

jueves, 1 de noviembre de 2012

Crear interfaces virtuales en Solaris

1- Creamos la interfaz virtual como superusuario:

ifconfig bnx222001 plumb -----> Donde el nro 222 corresponde a la vlan donde trabajara la interfaz

2- Configuramos la ip de la nueva interfaz

ifconfig bnx222001 192.168.1.100 netmask 255.255.255.0 up

3- Creamos el archivo hostname.bnx222001 , dentro del mismo agregamos el nombre del equipo (hostaname) , con el fin de que los cambios en la interfaz queden grabados , evitando que se pierdan luego de un reinicio :

touch /etc/hostname.bnx222001

vi /etc/hostname.bnx222001 ->donde añadimos el nombre del equipo , en mi caso FileServer

4- Dentro del fichero /etc/hosts añadimos el mismo nombre de equipo y la ip asignada a la interfaz creada:
vi /etc/hosts
192.168.1.100 FileServer

Scritpt para saber tamaño de disco en Solaris


Script
bash-3.00# cat script_disl_size.sh
#!/bin/ksh
pfexec fdisk -G /dev/rdsk/c0t60060E80104644A004Fs0 | tail -1 | nawk '{
ncyl=$2
nhead=$5
nsect=$6
secsz=$7
sectors=ncyl*nhead*nsect;
bytes=sectors/(1024/secsz);
printf("%7d MiB %7d MB\n", bytes/1024, bytes*1024/1000/1000);
}'

Resultado
bash-3.00# sh script_disl_size.sh
102398 MiB 107372 MB

Resultado del comando iostat -E , que muestra resultados similares
bash-3.00# iostat -E
sd0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: HITACHI Product: DF600F Revision: 0000 Serial No:
Size: 107.37GB <107374181888 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 1 Predictive Failure Analysis: 0
sd1 Soft Errors: 0 Hard Errors: 1 Transport Errors: 0
Vendor: TSSTcorp Product: DVD-ROM TS-L333H Revision: ID03 Serial No:
Size: 0.00GB <0 bytes>
Media Error: 0 Device Not Ready: 1 No Device: 0 Recoverable: 0
Illegal Request: 2 Predictive Failure Analysis: 0

jueves, 27 de septiembre de 2012

Creacion y configuracion de Zonas en Solaris

1- Paquetes necesarios :
SUNWcakr.i
SUNWcar.i
SUNWckr
SUNWcnetr
SUNWcsd
SUNWcsl
SUNWcsr
SUNWcsu
SUNWkvm.i
SUNWlucfg
SUNWlur
SUNWluu
SUNWluzone
SUNWlxml
SUNWpool
SUNWpoolr
SUNWtecla
SUNWtsg
SUNWzfsu
SUNWzoner
SUNWzoneu
SUNWzoneu

2- Activar el servicio
Para que nuestras zonas arranquen cuando se reinicie la máquina ejecutamos:
#svcadm enable zones

3- Crear la zona  

bash-3.00# zonecfg -z oaszone
zonecfg:oaszone> create

4- Definicion de la ruta de acceso 

zonecfg:oaszone> set zonepath=/zonas/oaszone

5- Configuramos su interface ethernet 

zonecfg:oaszone> add net
zonecfg:oaszone:net> set address=192.168.236.11/24

zonecfg:oaszone:net> set physical=bnx252001
zonecfg:oaszone:net> set defrouter=192.12.236.1
zonecfg:oaszone:net> end

6- Permitimos que bootee automaticamente 

zonecfg:oaszone> set autoboot=true

7- Definimos la cantidad cpu que utilizara la zona  

zonecfg:myzone> add capped-cpu
zonecfg:myzone>capped-cpu> set ncpus=4
zonecfg:myzone>capped-cpu>capped-cpu> end

8- Hacemos lo mismo con la cantidad de memoria ram 

zonecfg:oaszone> add capped-memory
zonecfg:oaszone:capped-memory> set physical=8G
zonecfg:oaszone:capped-memory> end

9- "Compilamos " los cambios realizados 

zonecfg:oaszone> commit
zonecfg:oaszone> exit

10- Creamos el directorio donde de estara la zona en la zona no global  

mkdir /zonas/oaszone

11- Asignamos los permisos recomendados al path creado 

chmod 700 /zonas/oaszone/

12- Verificamos las configuraciones hechas para la zona creada 

zoneadm -z oaszone verify

13- Instalamos la zona  

zoneadm -z oaszone install

14- Iniciamos la zona creada 

zoneadm -z oaszone boot

15- Informacion acerca de la zona 

zonecfg:oaszone> info

16- Ingreso a la zona 

zlogin -C oaszone

17- Creacion - adicion de un file system solo a la zona creada 

VER : http://www.infochotos.com/2012/07/linuxunixcomo-agregar-disco-duro-nuevo.html

18- Eliminar el filesystem de una zona en particular  

zonecfg:oaszone> remove fs dir=/u01

viernes, 3 de agosto de 2012

Comandos Magicos para que el Solaris reconozca un nuevo disco sin reiniciar el equipo


Comando mágico 1  : cfgadm -al
Comando mágico 2  : devfsadm -Vc

Correrlos de acuerdo a este orden y les aseguro que los discos o lun´s de storages que agregaron a su servidor seran reconocidos sin la necesidad de reiniciarlo , salvandonos de bajar instancias de bd o servicios que corrian .

lunes, 30 de julio de 2012

Apagar , reiniciar y desinstalar Zonas en Solaris

Apagar Zonas


1. Ver las zonas que corren en nuestro sistema :

zonaglobal# zoneadm list -v
ID NAME STATUS PATH BRAND IP

0 zonaglobal running / native shared

1 my-zone running /export/home/my-zone native shared


2. Apagamos la zona con el comando halt :

zonaglobal# zoneadm -z my-zone halt


3. La iniciamos de vuelta :
zonaglobal# zoneadm -z my-zone boot

Reiniciar Zonas


1. Ver las zonas que corren en nuestro sistema.
zonaglobal# zoneadm list -v
ID NAME STATUS PATH BRAND IP
0 zonaglobal running / native shared
1 my-zone running /export/home/my-zone native shared

2. Reiniciamos con el comando reboot

zonaglobal# zoneadm -z my-zone reboot

3. Vemos las zonas que corren en nuestro sistema para verificar que my-zone fue reiniciada:
zonaglobal# zoneadm list -v

ID NAME STATUS PATH BRAND IP

0 zonaglobal running / native shared

2 my-zone running /export/home/my-zone native shared

OBS : Notese que el ID de la zona my-zone ha cambiado . Esto generalmente sucede luego de reinciarla.


Desinstalar Zonas

1. Ver las zonas que corren en nuestro sistema.
zonaglobal# zoneadm list -v
ID NAME STATUS PATH BRAND IP
0 zonaglobal running / native shared
1 my-zone running /export/home/my-zone native shared

2. Desinstalamos la zona con el comando uninstall
global# zoneadm -z my-zone uninstall -F
El comando -F lo usamos para forzar la desinstalacion de la zona .

3. Vemos las zonas que corren en nuestro sistema para verificar que my-zone fue desinstalada:
zonaglobal# zoneadm list -v

ID NAME STATUS PATH BRAND IP

0 global running / native shared

Agregar disco duro nuevo a una ZONA de Solaris


DESDE LA ZONA GLOBAL

1) Chequeamos que el nuevo disco sea reconocido:

#cfgadm -al
#devfsadm

2) Notamos que hay un nuevo disco en otro bus :
# ls /dev/rdsk/*s0
/dev/rdsk/c0t0d0s0 /dev/rdsk/c1t0d0s0 /dev/rdsk/c0t60060E80104643C004F2B7EC00000023d0s0

3) Empezamos con el formateo del nuevo disco (incluyendo la creacion de particiones):
# format
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@0,0/pci1000,30@10/sd@0,0
1. c0t60060E80104643C004F2B7EC00000023d0
/pci@0,0/pci1000,30@10/sd@1,0
Specify disk (enter its number):

4) Seleccionamos el disco con la opcion 1, el cual es el nuevo disco adicionado . Es posible que el disco sea preformateado en algunos casos , al tipear ENTER.

selecting c0t60060E80104643C004F2B7EC00000023d0
[disk formatted]

5) Con el comando fdisk crearemos la partición que precisemos, por defecto al tipear "y" crea un partición Solaris por default , lo cual hacemos a continuación.
#format> fdisk
No fdisk table exists. The default partition for the disk is:
a 100% “SOLARIS System” partition

Type “y” to accept the default partition, otherwise type “n” to edit the
partition table.
y

4) Entramos en el submenu del modulo format llamado partition :
format> partition

5) Imprimimos la partition existente:

partition> print
Current partition table (original):
Total disk cylinders available: 1020 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 – 1020 5.99GB (1021/0/0) 4182016
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 – 0 2.00MB (1/0/0) 4096
9 unassigned wm 0 0 (0/0/0) 0

6) Seleccionamos la particion donde queremos asignar nuestro disco (tamaño total o particionado) :
partition> 0
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]: 1
Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 1019c

7) Imprimiendo la tabla de particiones de vuelta vemos los cambios hechos :

partition> print
Current partition table (unnamed):
Total disk cylinders available: 1020 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 1 – 1019 1.99GB (1019/0/0) 4173824
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 – 1020 1.99GB (1021/0/0) 4182016
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 – 0 2.00MB (1/0/0) 4096
9 unassigned wm 0 0 (0/0/0) 0

8) Guardamos los cambios escribiendo label en el disco:

partition> label
Ready to label disk, continue? y

9 ) Salimos del submenu partition y del modulo format

partition> quit
format> quit
#

10 ) Creamos el sistema de archivos , en este caso UFS.

# newfs /dev/rdsk/c0t60060E80104643C004F2B7EC00000023d0s0
newfs: construct a new file system /dev/rdsk/c1t1d0s0: (y/n)? y
/dev/rdsk/c1t1d0s0: 4173824 sectors in 1019 cylinders of 128 tracks, 32 sectors
2038.0MB in 45 cyl groups (23 c/g, 46.00MB/g, 11264 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 94272, 188512, 282752, 376992, 471232, 565472, 659712, 753952, 848192,
3298432, 3392672, 3486912, 3581152, 3675392, 3769632, 3863872, 3958112,
4052352, 4146592

11 ) Verificamos que el nuevo filesystem este limpio :

# fsck /dev/rdsk/c1t1d0s0
** /dev/rdsk/c1t1d0s0
** Last Mounted on
** Phase 1 – Check Blocks and Sizes
** Phase 2 – Check Pathnames
** Phase 3a – Check Connectivity
** Phase 3b – Verify Shadows/ACLs
** Phase 4 – Check Reference Counts
** Phase 5 – Check Cylinder Groups
2 files, 9 used, 2020758 free (14 frags, 252593 blocks, 0.0% fragmentation)

OBS :Como esto lo hacemos desde la zona global , no existe la necesidad de agregar la linea del Nuevo disco en el etc/vfstab


DESDE NUESTRA ZONA

12 ) Ingresamos a la zona donde queremos agregar el nuevo disco :

zonecfg -z <nombre zona>

zonecfg:my-zone> add fs

zonecfg:my-zone:fs> set dir=/data  ----->> Directorio donde se montara el disco

zonecfg:my-zone:fs> set special=/dev/dsk/c0t60060E80104643C004F2B7EC00000023d0s0

zonecfg:my-zone:fs> set raw=/dev/rdsk/c0t60060E80104643C004F2B7EC00000023d0s0

zonecfg:my-zone:fs> set type=ufs

zonecfg:my-zone:fs> end

zonecfg:my-zone>commit

zonecfg:my-zone>exit

13) Reiniciamos la zona y después verificamos que el nuevo filesystem aparezca con df –h :

zoneadm -z my-zone reboot

lunes, 9 de julio de 2012

Agregar ruta por defecto en Solaris

Agregando ruta por defecto en solaris es muy sencillo. Si tratamos de agregar solo una ruta temporalmente lo hacemos con el siguiente comando . El mismo se borrara al reiniciarse el equipo :

Ejemplo: route add default 192.168.1.1

Si queremos que la ruta sea persistente al reiniciar el sistema , debemos agregar una ruta en el archivo /etc/defaulrouter :

Ejemplo: echo 192.168.1.1 > /etc/defaultrouter

viernes, 18 de mayo de 2012

Solaris.Como encontrar el wwn (World Wide Name) de los hba´s conectados

Linux.Unix.Como encontrar el wwn (World Wide Name) de los hba´s conectados en Solaris

World Wide Name (WWN) are unique 8 byte (64-bit) identifiers in SCSI or fibre channel similar to that of MAC Addresses on a Network Interface Card (NIC).

Talking about the WWN names, there are also
World Wide port Name (WWpN), a WWN assigned to a port on a Fabric which is what you would be looking for most of the time.

World Wide node Name (WWnN), a WWN assigned to a node/device on a Fibre Channel fabric.
To find the WWN numbers of your HBA card in Sun Solaris, you can use one the following procedures

Using fcinfo (Solaris 10 only)
This is probably the easiest way to find the WWN numbers on your HBA card. Here you can see the HBA Port WWN (WWpN) and the Node WWN (WWnN) of the two ports on the installed Qlogic HAB card.

This is also useful in finding the Model number, Firmwar version FCode, supported and current speeds and the port status of the HBA card/port.

 root@ sunserver:/root# fcinfo hba-port | grep WWN
HBA Port WWN: 2100001b32xxxxxx
Node WWN: 2000001b32xxxxxx
HBA Port WWN: 2101001b32yyyyyy
Node WWN: 2001001b32yyyyyy

For detailed info including Make & model number, Firmware, Fcode and current status and supported/current speeds then

root@ sunserver:/root# fcinfo hba-port
HBA Port WWN: 2100001b32xxxxxx
OS Device Name: /dev/cfg/c2
Manufacturer: QLogic Corp.
Model: 375-3356-02
Firmware Version: 4.04.01
FCode/BIOS Version: BIOS: 1.24; fcode: 1.24; EFI: 1.8;
Type: N-port
State: online
Supported Speeds: 1Gb 2Gb 4Gb
Current Speed: 4Gb
Node WWN: 2000001b32xxxxxx
HBA Port WWN: 2101001b32yyyyyy
OS Device Name: /dev/cfg/c3
Manufacturer: QLogic Corp.
Model: 375-3356-02
Firmware Version: 4.04.01
FCode/BIOS Version: BIOS: 1.24; fcode: 1.24; EFI: 1.8;
Type: unknown
State: offline
Supported Speeds: 1Gb 2Gb 4Gb
Current Speed: not established
Node WWN: 2001001b32yyyyyy

Using scli
root@ sunserver:/root# scli -i | egrep “Node Name|Port Name”
Node Name : 20-00-00-1B-32-XX-XX-XX
Port Name : 21-00-00-1B-32-XX-XX-XX
Node Name : 20-01-00-1B-32-YY-YY-YY
Port Name : 21-01-00-1B-32-YY-YY-YY

For more detailed info on the HBA Cards run as follows: Similar to fcinfo but also provides Model Name and serial number.

root@ sunserver:/root# scli -i
——————————————————————————
Host Name : sunserver
HBA Model : QLE2462
HBA Alias :
Port : 1
Port Alias :
Node Name : 20-00-00-1B-32-XX-XX-XX
Port Name : 21-00-00-1B-32-XX-XX-XX
Port ID : 11-22-33
Serial Number : AAAAAAA-bbbbbbbbbb
Driver Version : qlc-20080514-2.28
FCode Version : 1.24
Firmware Version : 4.04.01
HBA Instance : 2
OS Instance : 2
HBA ID : 2-QLE2462
OptionROM BIOS Version : 1.24
OptionROM FCode Version : 1.24
OptionROM EFI Version : 1.08
OptionROM Firmware Version : 4.00.26
Actual Connection Mode : Point to Point
Actual Data Rate : 2 Gbps
PortType (Topology) : NPort
Total Number of Devices : 2
HBA Status : Online
——————————————————————————
Host Name : sunserver
HBA Model : QLE2462
HBA Alias :
Port : 2
Port Alias :
Node Name : 20-01-00-1B-32-YY-YY-YY
Port Name : 21-01-00-1B-32-YY-YY-YY
Port ID : 00-00-00
Serial Number : AAAAAAA-bbbbbbbbbb
Driver Version : qlc-20080514-2.28
FCode Version : 1.24
Firmware Version : 4.04.01
HBA Instance : 3
OS Instance : 3
HBA ID : 3-QLE2462
OptionROM BIOS Version : 1.24
OptionROM FCode Version : 1.24
OptionROM EFI Version : 1.08
OptionROM Firmware Version : 4.00.26
Actual Connection Mode : Unknown
Actual Data Rate : Unknown
PortType (Topology) : Unidentified
Total Number of Devices : 0
HBA Status : Loop down



Using prtconf


root@ sunserver:/root# prtconf -vp | grep -i wwn
port-wwn: 2100001b.32xxxxxx
node-wwn: 2000001b.32xxxxxx
port-wwn: 2101001b.32yyyyyy
node-wwn: 2001001b.32yyyyyy

Using prtpicl


root@ sunserver:/root# prtpicl -v | grep wwn
:node-wwn 20 00 00 1b 32 xx xx xx
:port-wwn 21 00 00 1b 32 xx xx xx
:node-wwn 20 01 00 1b 32 yy yy yy
:port-wwn 21 01 00 1b 32 yy yy yy



Using luxadm

Run the following command to obtain the physical path to the HBA Ports


root@ sunserver:/root$ luxadm -e port
/devices/pci@400/pci@0/pci@9/SUNW,qlc@0/fp@0,0:devctl CONNECTED
/devices/pci@400/pci@0/pci@9/SUNW,qlc@0,1/fp@0,0:devctl NOT CONNECTED



With the physical path obtained from the above command, we can trace the WWN numbers as follows. here I use the physical path to the one that is connected:


root@ sunserver:/root$ luxadm -e dump_map /devices/pci@400/pci@0/pci@9/SUNW,qlc@0/fp@0,0:devctl
Pos Port_ID Hard_Addr Port WWN Node WWN Type
0 123456 0 1111111111111111 2222222222222222 0×0 (Disk device)
1 789123 0 1111111111111111 2222222222222222 0×0 (Disk device)
2 453789 0 2100001b32xxxxxx 2000001b32xxxxxx 0x1f (Unknown Type,Host Bus Adapter)

jueves, 22 de marzo de 2012

How to Log In to a Remote Host With Solaris Secure Shell



  1. Start a Solaris Secure Shell session.
    Type the ssh command, and specify the name of the remote host.

    myLocalHost% ssh myRemoteHost
    
    A prompt questions the authenticity of the remote host:

    The authenticity of host 'myRemoteHost' can't be established.
    RSA key fingerprint in md5 is: 04:9f:bd:fc:3d:3e:d2:e7:49:fd:6e:18:4f:9c:26
    Are you sure you want to continue connecting(yes/no)? 
    This prompt is normal for initial connections to remote hosts.
  2. If prompted, verify the authenticity of the remote host key.
    • If you cannot confirm the authenticity of the remote host, type no and contact your system administrator.

      Are you sure you want to continue connecting(yes/no)? no
      
      The administrator is responsible for updating the global /etc/ssh/ssh_known_hosts file. An updated ssh_known_hosts file prevents this prompt from appearing.
    • If you confirm the authenticity of the remote host, answer the prompt and continue to the next step.

      Are you sure you want to continue connecting(yes/no)? yes
      
  3. Authenticate yourself to Solaris Secure Shell.
    1. When prompted, type your passphrase.

      Enter passphrase for key '/home/jdoe/.ssh/id_rsa': <Type passphrase>
      
    2. When prompted, type your account password.

      jdoe@myRemoteHost's password: <Type password>
      Last login: Fri Jul 20 14:24:10 2001 from myLocalHost
      myRemoteHost%
  4. Conduct transactions on the remote host.
    The commands that you send are encrypted. Any responses that you receive are encrypted.
  5. Close the Solaris Secure Shell connection.
    When you are finished, type exit or use your usual method for exiting your shell.

    myRemoteHost% exit
    myRemoteHost% logout
    Connection to myRemoteHost closed
    myLocalHost%

How to Generate a Public/Private Key Pair for Use With Solaris Secure Shell

Users must generate a public/private key pair when their site implements host-based authentication or user public-key authentication. For additional options, see the ssh-keygen(1) man page.
Before You Begin
Determine from your system administrator if host-based authentication is configured.

  1. Start the key generation program.

    myLocalHost% ssh-keygen -t rsa
    Generating public/private rsa key pair.
    …
    where -t is the type of algorithm, one of rsadsa, or rsa1.
  2. Specify the path to the file that will hold the key.
    By default, the file name id_rsa, which represents an RSA v2 key, appears in parentheses. You can select this file by pressing theReturn key. Or, you can type an alternative file name.

    Enter file in which to save the key (/home/jdoe/.ssh/id_rsa):<Press Return>
    
    The file name of the public key is created automatically by appending the string .pub to the name of the private key file.
  3. Type a passphrase for using your key.
    This passphrase is used for encrypting your private key. A null entry is strongly discouraged. Note that the passphrase is not displayed when you type it in.

    Enter passphrase (empty for no passphrase): <Type passphrase>
    
  4. Retype the passphrase to confirm it.

    Enter same passphrase again: <Type passphrase>
    Your identification has been saved in /home/jdoe/.ssh/id_rsa.
    Your public key has been saved in /home/jdoe/.ssh/id_rsa.pub.
    The key fingerprint is:
    0e:fb:3d:57:71:73:bf:58:b8:eb:f3:a3:aa:df:e0:d1 jdoe@myLocalHost
  5. Check the results.
    Check that the path to the key file is correct.

    % ls ~/.ssh
    id_rsa
    id_rsa.pub
    At this point, you have created a public/private key pair.
  6. Choose the appropriate option:
    • If your administrator has configured host-based authentication, you might need to copy the local host's public key to the remote host.
      You can now log in to the remote host. For details, see How to Log In to a Remote Host With Solaris Secure Shell.
      1. Type the command on one line with no backslash.

        % cat /etc/ssh/ssh_host_dsa_key.pub | ssh RemoteHost \
        'cat >> ~./ssh/known_hosts && echo "Host key copied"'
        
      2. When you are prompted, supply your login password.

        Enter password: <Type password>
        Host key copied
        %
    • If your site uses user authentication with public keys, populate your authorized_keys file on the remote host.
      1. Copy your public key to the remote host.
        Type the command on one line with no backslash.

        myLocalHost% cat $HOME/.ssh/id_rsa.pub | ssh myRemoteHost \
        'cat >> .ssh/authorized_keys && echo "Key copied"'
        
      2. When you are prompted, supply your login password.
        When the file is copied, the message “Key copied” is displayed.

        Enter password: Type login password
        Key copied
        myLocalHost%
  7. (Optional) Reduce the prompting for passphrases.
    For a procedure, see How to Reduce Password Prompts in Solaris Secure Shell. For more information, see the ssh-agent(1) and ssh-add(1) man pages.


Example 19–2 Establishing a v1 RSA Key for a User

In the following example, the user can contact hosts that run v1 of the Solaris Secure Shell protocol. To be authenticated by v1 hosts, the user creates a v1 key, then copies the public key portion to the remote host.

myLocalHost% ssh-keygen -t rsa1 -f /home/jdoe/.ssh/identity
Generating public/private rsa key pair.
…
Enter passphrase (empty for no passphrase): <Type passphrase>
Enter same passphrase again: <Type passphrase>
Your identification has been saved in /home/jdoe/.ssh/identity.
Your public key has been saved in /home/jdoe/.ssh/identity.pub.
The key fingerprint is:
…
myLocalHost% ls ~/.ssh
id_rsa
id_rsa.pub
identity
identity.pub
myLocalHost% cat $HOME/.ssh/identity.pub | ssh myRemoteHost \
'cat >> .ssh/authorized_keys && echo "Key copied"'

viernes, 16 de marzo de 2012

Ficheros para configuración de red en Solaris

Cuando configuramos los parámetros de red en Solaris, lo hacemos mediante línea de comandos. Pero para que los cambios perduren después del reinicio de la máquina hay que volcar los datos en ficheros de configuración.


En este artículo explicaremos los diferentes ficheros de configuración de red de Solaris.


/etc/hostname.interface

Define el hostname que tendrá cada interfaz de red.


/etc/nodename

Contiene el hostname local del equipo.


/etc/defaultdomain

Contiene el nombre del dominio del equipo.


/etc/defaultrouter

Contiene la puerta de enlace por defecto.


/etc/inet/hosts

Contiene la resolución IP/host. Tiene un softlink en el fichero /etc/hosts.

/etc/inet/netmasks

Contiene la máscara de red de cada IP.

jueves, 23 de febrero de 2012

Solaris.Set date and time


Setting the system date and time is fairly easy on solaris. Because you can easily set the time from the command line, you can set the time on a server remotely.
date mmddhhmmyy
The date command takes the syntax mmddhhmmyy, or “month day hour minute year”. You have to be superuser to set the time.
Example:
# date 1201010106
Fri Dec  1 01:01:00 PST 2006

Solaris.Identificar procesos zombie en Solaris


bash-3.00# ps -fe | grep defunc
    root 21056 21055   0        - ?           0:00 <defunct>
    root 21078 17687   0 10:53:27 pts/6       0:00 grep defunc

Solaris.Habilitar el acceso por ssh del usuario root


Por defecto el acceso por ssh del usuario root esta desactivado en Solaris , para habilitarlo hacemos los siguiente :
1. Cambiamos en el archivo /etc/ssh/sshd_config la opcion PermitRootLogin :
PermitRootLogin no
por ,
PermitRootLogin yes

2. Reiniciamos el servicio ssh y probamos el acceso como root
#svcadm restart svc:/network/ssh:default

Solaris.Commands to connect SAN Disk´s


Commands to connect SAN Disk´s on SOLARIS

There are always a bunch of strange commands to connect a server to SAN disks. In my case, I’m running Solaris 9, using QLogic Fibre Channel cards, and connecting to an SUN M5000 & Dell PE R710

1) Connect the Solaris server SAN disks.

 After I made the connection, the GUI that allows me to zone the SAN recognized the QLogic connections, and I zoned the LUNs.

2) Scan your disks

, and it should show up as a new disk when you run “format”.

Solaris# devfsadm
Solaris# format

My result: No new disks.  Sigh.

3) Run a bunch of cryptic but useful diagnostic commands:


To see your HBA ports and whether you’re connected:

Solaris# luxadm -e port
Found path to 3 HBA ports
/devices/pci@8,700000/SUNW,qlc@2/fp@0,0:devctl        CONNECTED
/devices/pci@8,700000/SUNW,qlc@2,1/fp@0,0:devctl     CONNECTED
/devices/pci@8,600000/SUNW,qlc@4/fp@0,0:devctl        CONNECTED

To see your disks:

Solaris# luxadm probe

To see your HBA ports (type fc-private, below) and their connected disks (type disk):

Solaris# cfgadm -al

Ap_Id                         Type           Receptacle  Occupant Condition
c8                               fc-private  connected configured unknown
c8::200800a0b8199b3b  disk           connected configured unknown
c9                               fc-private  connected configured unknown
c9::200900a0b8199b3b   disk          connected configured unknown

4) Force Fibre Channel SAN disk rescan

, since everything looks connected and okay.  Use your device path from “luxadm -e port” output.

Solaris# luxadm -e forcelip /devices/pci@8,700000/SUNW,qlc@2/fp@0,0:devctl
Solaris# luxadm -e forcelip /devices/pci@8,700000/SUNW,qlc@2,1/fp@0,0:devctl
Solaris# luxadm -e forcelip /devices/pci@8,600000/SUNW,qlc@4/fp@0,0:devctl

5) Rerun format command.


Solaris # format

AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w500000e0107111e1,0
1. c1t1d0 t2
/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w500000e01070d761,0
2. c7t600A0B801019B1B2002032A5489C60F3d0
/scsi_vhci/ssd@g600a0b801019b1b2002032a5489c60f3

and There it is, disk #2.