Thursday, August 23, 2012

SOLARIS

1- SOLARIS VERSION
SunOS 5.0 = Solaris 2.0
SunOS 5.1 = Solaris 2.1
SunOS 5.2 = Solaris 2.2
SunOS 5.3 = Solaris 2.3
SunOS 5.4 = Solaris 2.4
SunOS 5.5 = Solaris 2.5
SunOS 5.6 = Solaris 2.6
SunOS 5.7 = Solaris 7
SunOS 5.8 = Solaris 8
SunOS 5.9 = Solaris 9
SunOS 5.10 = Solaris 10


2- VRTSexplorer

Untar the downloaded file (only if the VRTSexplorer utility has been downloaded and not installed with the VRTSspt package) :
# zcat vxexplore.tar.Z | tar xvf -

3- UNZIP .TAR.GZ
bash-3.00# gzip -dc se3kxtr.036.tar.gz | tar xvf -

4- IDENTIFIED HBA
bash-3.00$ cat prtpicl-v.out scsi-2|egrep ":initiator-port|:devfs-path|:driver-name|:firmware-version|:model|:version|:subsystem-id"
more prtpicl-v.out | egrep "devfs-path|driver-name|subsystem-id" | nawk '/:subsystem-id/ { print $0; getline; print $0; getline; print $0; }' | nawk -F: '{ print $2
}'

5- SFTP
#sftp root@a.b.c.d

6- DISK Troubleshooting files

If you are running Solaris on this system, the data which interests me is the /var/adm/messages file as well as outputs
from the following commands:
# iostat -En
# echo | format
In addition, if you are running a volume manager, I need additional outputs:
If you use SVM:
# metastat -t
# metadb -i
If you use ZFS:
# zpool status -v
# zpool list
If you use VxVM:
# vxdisk list
# vxprint -Ath
# vxdisk path

If you are running Linux, in addition to the log (/var/log/messages) file, I also need:
# fdisk -l
# fdisk -l /dev/sd?
# fdisk -l /dev/hd?
# cat /proc/mdstat
# mdadm --query /dev/md*

7- Resetting forgotten root password

The following procedure may be used to reset a forgotten root password on a Solaris system. You will need physical or remote console access to the system to use these steps.
Press Stop-A on the console or Ctrl-] and send brk from a remote console connection to access the Open Boot PROM (OBP).
Insert a bootable Solaris CD/DVD and boot into single-user mode with boot cdrom -s
If a JumpStart boot server is located on the system's subnet, and the system was properly configured for JumpStart, you may instead boot over the network into single-user mode with boot net -s
Make a mount point within the /tmp file system by typing mkdir /tmp/mnt
Mount the root partition of your boot disk in /tmp/mnt
e.g. mount /dev/dsk/c0t0d0s0 /tmp/mnt
Edit /etc/shadow with TERM=vt100 vi /tmp/mnt/etc/shadow
Remove the encrypted part of the root password (the second field; fields are separated by colons), save, and exit.
Unmount the file system with umount /tmp/mnt
Reboot the system and assign a new password at a shell prompt with the passwd command.
If you are unable to run vi above, you can edit /etc/shadow using the ed editor.

# ed /tmp/mnt/etc/shadow
1p
s/:.............:/::/ (Note: there are 13 dots in the second field)
1p
w
q

8- Enable ssh root login in Solaris 10


1. Change the file /etc/ssh/sshd_config with PermitRootLogin yes to replace PermitRootLogin no

2. restart the services

#svcadm restart svc:/network/ssh:default

Enable FTP Solaris 10

Thanks for the overwhelming responses, summarized as below

How to enable root ftp to solaris 9 server ?
#vi /etc/services               - uncomment
-> ftp 21/tcp
#vi /etc/inetd.conf     - uncomment
-> ftp stream tcp nowail root /usr/sbin/in.ftpd in.ftpd
# vi /etc/ftpd/ftpuser  - to uncomment "root" out
-> # root              
#vi /etc/shells         - put in all the shell as possible
-> /usr/sbin/ksh
#vi /etc/default/login  - to uncomment
-> CONSOLE=/dev/console
check ftp.allow and ftp.deny files as well
#kill -HUP pid   - to restart #/usr/sbin/inetd -s

A lot of responses suggested using more secure ftp like
proftp/ssh/scp/sftp or normal user to ftp in then #sudo – root
Get status of ftp service
Code:
inetadm | grep ftp
Enable ftp
Code:
inetadm -e ftp
Disable ftp
Code:
inetadm -d ftp
More info
Code:
man inetadm
man svcadm

"/usr/sbin/svcadm enable ftp" 
"/usr/sbin/svcadm disable ftp"

9- Change keyboard layout SOLARIS to spanish

bash-3.00# pwd
/boot/solaris
bash-3.00#
bash-3.00#
bash-3.00# vi bootenv.rc

"bootenv.rc" 24 lines, 702 characters
#
# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

#ident  "@(#)bootenv.rc 1.33    07/03/03 SMI"
#
#       bootenv.rc -- boot "environment variables"
#
setprop ata-dma-enabled '1'
setprop atapi-cd-dma-enabled '0'
setprop ttyb-rts-dtr-off 'false'
setprop ttyb-ignore-cd 'true'
setprop ttya-rts-dtr-off 'false'
setprop ttya-ignore-cd 'true'
setprop ttyb-mode '9600,8,n,1,-'
setprop ttya-mode '9600,8,n,1,-'
setprop lba-access-ok '1'
setprop prealloc-chunk-size '0x2000'
setprop bootpath '/pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0:a'
setprop keyboard-layout 'Spanish'
setprop console 'text'
setprop nvramrc ''
"bootenv.rc" 24 lines, 702 characters
#
# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

#ident  "@(#)bootenv.rc 1.33    07/03/03 SMI"
#
#       bootenv.rc -- boot "environment variables"
#
setprop ata-dma-enabled '1'
setprop atapi-cd-dma-enabled '0'
setprop ttyb-rts-dtr-off 'false'
setprop ttyb-ignore-cd 'true'
setprop ttya-rts-dtr-off 'false'
setprop ttya-ignore-cd 'true'
setprop ttyb-mode '9600,8,n,1,-'
setprop ttya-mode '9600,8,n,1,-'
setprop lba-access-ok '1'
setprop prealloc-chunk-size '0x2000'
setprop bootpath '/pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0:a'
setprop keyboard-layout 'Spanish'
setprop console 'text'
setprop nvramrc ''
setprop altbootpath '/pci@0,0/pci-ide@1,1/ide@0/cmdk@1,0:a'


10- Mount File System using VBOX

mount -F vboxfs jackshare /export/home/jack/mount 

11- Solaris Starting and Stopping dtlogin (CDE)

by Vivek Gite on March 6, 2006 · 3 comments· Last updated March 6, 2006
Source: http://www.cyberciti.biz/tips/solaris-starting-and-stopping-dtlogin-cde.html

It is always good idea not to use the X windows system on dedicated Solaris servers. GUI consumes more resources (such as CPU, Memory). However, Solaris by default installs CDE or Gnome desktop.

If your Linux system boot to a shell prompt, you can start X window (GUI system) by typing following command:

$ startx

dtlogin script
Solaris do not use startx command. It comes with dtlogin script located in /etc/init.d directory. It is a display manager for the X Window System

Stopping dtlogin

# /etc/init.d/dtlogin stop

Starting dtlogin
If your Solaris system boot to a shell prompt, you can start X/dtlogin with following command:

# /etc/init.d/dtlogin start

Restart dtlogin
If dtlogin is not responding then you can restart it using ssh:

# /etc/init.d/dtlogin restart

Permanently disable dtlogin
If you wish to disable dtlogin, use dtconfig command. It is a desktop configuration utility for Solaris. This command is located at /usr/dt/bin/dtconfig. Login as a root user before using dtconfig command.

To disabled dtlogin type command:

# /usr/dt/bin/dtconfig -d

To enable dtlogin type command:

# /usr/dt/bin/dtconfig -e

To kill dtlogin type command:

# /usr/dt/bin/dtconfig -kill

Read man page of dtlogin for more information.
 
12- Solaris How to install .pkg file
 
How to install .pkg file pkgadd -d ./VBoxSolarisAdditions.pkg 
My status