Wednesday, June 25, 2008

Solaris Boot Process -1

Boot Process
0.Power On the server
1. Boot PROM

  • PROM load POST
  • OK prompt
  • Boot loader load from boot devices
  • Boot reads Boot Block (first 15 sectors)
  • a copy of the bootblk is available at /usr/platform/`arch - k`/lib/fs/ufs/bootblk
  • Boot load Boot block

2. Boot Program

  • Boot Block loads secondary Boot loader(UFS boot)
  • (/platform/`arch -k`/ufsboot) UFS boot will load kernel
    Kernel is two parts
    Gen UNIX =>Platform independent (/kernel/genunix )
    Unix => Platform dependant (/platform/`arch -k`/kernel/*)

3. Kernel Initialization

  • Kernel reads config files(/etc/system)
  • Kernel initializes itself & load modules
  • Force load option in /etc/system –used to mount module permanently
  • The kernel creates PID 0 ( sched)

4. Init phase

  • The kernel start PID1 -init (/sbin/init)
  • Init process reads /etc/inittab file and /etc/init/default
  • Init starts rc scripts (/sbin/rc#) [# indicate runlevel]
  • rc script executes the files in /etc/rc#.d

How to get server hardware information ?

Type the following command to get your server hardware information
#/usr/platform/`uname -i`/sbin/prtdiag

Solaris User account Management

User Administration
Below 3 files are important for creating new user account
/etc/passwd -contains user information.
/etc/shadow - information about password
/etc/group -information about group

# cat /etc/passwd
root:x:0:1:Super-User:/:/sbin/sh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
Username: Passwd: UID: GID: common name: home dir: Shell
-----------------------------------
/etc/shadow - info about password

# cat /etc/shadow
root:Sb3AZsvho.Flg:13600::::::
daemon:NP:6445::::::
sri:*LK*:::::::
rengs:yE3ME0wy9rSUI:13600::::::
Name:Passwd:Days from unix:min passwd age:Max passwd age:warn:inactive:expire:future purpose
-----------------------------------
/etc/group -info about group
bash-2.05# cat /etc/group
root::0:root
other::1:
sys::3:root,bin,sys,adm
name:grouppasswd:GID:secondary member list
-------------------------------------
UID informations
OS support max 2^31 users
0-99 reserved for system user
100-60000

1.Create new user account using useradd command
# useradd -u 606 -c rengarajang -md /export/rengs -s /bin/bash rengs
-u UID -c comment -md Home Dir -s Shell username

-u uid – Sets the unique UID for the new user.
-g group – Specifies a predefined group's ID or name.
-G group – Defines the new user's secondary group memberships.
-d dir – Defines the full pathname for the user’s home directory.
-m – Creates the new home directory if it does not already exist.
-s shell – Defines the full pathname for the shell program to be used as the user's login shell. If not defined, it defaults to /bin/sh.
–c comment – Typically used to specify the user’s full name and location.
-o – Allows a UID to be duplicated.
-e expire – Sets an expiration date on the user account. Specifies the date (mm/dd/yy) on which a user can no longer log in and access the account. The account is locked.
-f inactive – Sets the number of inactive days allowed on a user account. If the account is not logged into during the specified number of days it is locked.
-k skel_dir – Specifies an alternative directory location containing customized initialization files to be copied into the user’s home directory. (The default is /etc/skel.)

2.Creating alternate super account
# useradd -u 0 –o -c rengarajang -md / -s /bin/bash rengs

3.Modifying user properties using usermod
# usermod -u 606 -c Modifieduser rengs

4.Deleting user account
#userdel –r rengs

5.Managing groups we use following commands
Groupadd
Groupdel

6.Other files for user management
Below file should you modify to change the number of groups to which a user can belong
/etc/system
Default passwd policy in /etc/default/passwd
User profile files are stored in /etc/skel

Friday, June 20, 2008

How to create NIS user account?

How to create NIS user account?

1.Create the local user account on NIS server for ex,

# useradd -u 606 -c rengarajang -md /export/home/rengs -s /bin/bash rengs

set password for this account

#passwd rengs

New Password:*********
Re-enter new Password:*********
passwd: password successfully changed for rengs
Goto /var/yp directory and run make command this will update the nis passwd file

# cd /var/yp
#
/usr/ccs/bin/make
updated netid
pushed netid
Now you can login from NIS client

Wednesday, June 18, 2008

Free Open Solaris CD 2008

OpenSolaris 2008.05 for x86 is available to use free of charge and SUN can send you a CD at no extra cost.
Open Solaris

NIS Configuration script(solaris 10)

This script will configure NIS master server on solaris10

about the script:

  1. It will set the domain name, which u give
  2. NIS alternate directory will be created in /mynis folder
  3. It will copy the configuration files from /etc to /mynis folder
  4. edit the Makefile and passwd,shadow files then run ypinit -m command for NIS master.
  5. Start NIS services

Before run the script:

  1. Login as root
  2. check proper entries for ip,netmasks,gateway etc.,
  3. check autofs settings.

My NIS Configuration script

#!/usr/bin/bash

echo "################################"
echo "NIS server Configuration script"

echo "written by G.Rengarajan"
echo "################################"
echo "Backing up Make File"
cp /var/yp/Makefile Makefile.backup
echo "#############################################"
echo "Making New NIS server"
echo "#############################################"
echo "Type Your NIS DOMAIN NAME "
read name
echo $name" > /etc/defaultdomain
echo "Your NIS Domain name is `domainname`"
cat /etc/defaultdomain
echo "##### Making NIS Alternate Directory#####"
mkdir /mynis
mkdir /mynis/etc
mkdir /mynis/etc/security
mkdir /mynis/etc/inet
echo "Copying files from ETC directory to Alternate Directory"
echo "#########################################################"
cp /etc/auto_master /mynis/etc
cp /etc/auto_home /mynis/etc
cp /etc/group /mynis/etc
cp /etc/hosts /mynis/etc
cp /etc/inet/ipnodes /mynis/etc
cp /etc/netmasks /mynis/etc
#cp /etc/netgroup /mynis/etc
cp /etc/networks /mynis/etc
cp /etc/passwd /mynis/etc
cp /etc/shadow /mynis/etc
cp /etc/protocols /mynis/etc
cp /etc/services /mynis/etc
cp /etc/rpc /mynis/etc
cp /etc/user_attr /mynis/etc
cp /etc/publickey /mynis/etc
cp /etc/TIMEZONE /mynis/etc
cp /etc/inet/ipnodes /mynis/etc/inet
cp /etc/security/audit_user /mynis/etc/security
cp /etc/security/auth_attr /mynis/etc/security
cp /etc/security/exec_attr /mynis/etc/security
#I dont have following files so i`m creating empty file
touch /mynis/etc/ethers
touch /mynis/etc/bootparams
touch /mynis/etc/security/prof_attr
touch /mynis/etc/netgroup
touch /mynis/etc/timezone

echo "Configuration Files are copied to Alternate Directory"
echo "Adding entry to Makefile"
echo "***************************"
cat Makefile sed 's!^DIR =.*!DIR =/mynis/etc!g;s!^INETDIR=.*!INETDIR=/mynis/e
tc/inet!g;s!^RBACDIR=.*!RBACDIR=/mynis/etc/security!g;s!^PWDIR =.*!PWDIR =/mynis
/etc!g' > Makefile.tmp
mv Makefile.tmp Makefile
echo "removing lines that has root account from passwd and shadow files"
cat /mynis/etc/passwd sed 's!^root!#root!g' > /mynis/etc/passwd
cat /mynis/etc/shadow sed 's!^root!#root!g' > /mynis/etc/shadow
echo "Backing up NSSWITCH file"
cp /etc/nsswitch.conf /etc/nsswitch.backup
cp /etc/nsswitch.files /etc/nsswitch.conf
echo "-------------------------------"
echo "Configuring NIS Master server"
echo "-------------------------------"
/usr/sbin/ypinit -m
echo "NIS configured Successfully............."
echo "Satrting NIS services...."
/usr/lib/netsvc/yp/ypstart
echo "CONGRATULATIONS!!!"

SCRIPT OUTPUT...........

bash-3.00# ./nisconfig
################################
NIS server Configuration script

written by G.Rengarajan
################################
Backing up Make File
#############################################
Making New NIS server
#############################################
Type Your NIS DOMAIN NAME
INDIA
Your NIS Domain name is INDIA
##### Making NIS Alternate Directory#####
Copying files from ETC directory to Alternate Directory
#########################################################
Configuration Files are copied to Alternate Directory
Adding entry to Makefile
***************************
removing lines that has root account from passwd and shadow files
Backing up NSSWITCH file
-------------------------------
Configuring NIS Master server
-------------------------------
In order for NIS to operate sucessfully, we have to construct a list of the
NIS servers. Please continue to add the names for YP servers in order of
preference, one per line. When you are done with the list, type a <control D>
or a return on a line by itself.
next host to add: indigo
next host to add:

The current list of yp servers looks like this:
indigo
Is this correct? [y/n: y] y
Installing the YP database will require that you answer a few questions.
Questions will all be asked at the beginning of the procedure.
Do you want this procedure to quit on non-fatal errors? [y/n: n]
y
The yp domain directory is /var/yp/INDIA
There will be no further questions. The remainder of the procedure should take
5 to 10 minutes.
Building /var/yp/INDIA/ypservers...
Running /var/yp /Makefile...
updated passwd
updated group
updated hosts
updated ipnodes
updated ethers
updated networks
updated rpc
updated services
updated protocols
updated netgroup
updated bootparams
/var/yp/INDIA/mail.aliases: 12 aliases, longest 10 bytes, 138 bytes total
/usr/lib/netsvc/yp/mkalias /var/yp/`domainname`/mail.aliases /var/yp/`domainname
`/mail.byaddr;
updated aliases
updated publickey
updated netid
/usr/sbin/makedbm /mynis/etc/netmasks /var/yp/`domainname`/netmasks.byaddr;
updated netmasks
updated timezone
updated auto.master
updated auto.home
updated ageing
updated auth_attr
updated exec_attr
updated prof_attr
updated user_attr
updated audit_user

indigo has been set up as a yp master server without any errors.
If there are running slave yp servers, run yppush now for any data bases
which have been changed. If there are no running slaves, run ypinit on
those hosts which are to be slave servers.
NIS configured Successfully.............
Satrting NIS services....
starting NIS (YP server) services:ypstart: unable to enable svc:/network/nis/ser
ver:default; in maintenance
ypserv ypbind ypxfrd rpc.yppasswdd rpc.ypupdated done.
CONGRATULATIONS!!!
----------------------------------

Do you have any suggestion please let me know.....

Friday, June 13, 2008

Microsoft Windows on Sun

Sun and Microsoft understand how important it is to deliver and support integrated end-to-end solutions that provide unparalleled value to our customers. Now harness the power of Sun's robust enterprise class x86 servers preloaded with an option of Microsoft Windows Server Standard or Enterprise editions.
for more details....

How to check total size of the Directory?

#du -sh /folder path
above command will display the total size of the particular directory
# du -sh /tmp
72K /tmp

How to reset forgotten root user password

incase if you forgot the root password you can reset it in following steps:
1. Boot your system
2. At OK prompt type boot cdrom –s
4. Mount partition to /a directory mount /dev/dsk/c0t0d0s0 /a
5. Go to /a/etc directory cd /a/etc
6. Edit /etc/shadow file
7. In this shadow file remove 13 letter encrypted root password entry
root: s3fSGda2hDljk:0:3:whatever:/:/bin/sh
8. Save and reboot server

Thursday, June 12, 2008

How to enable telnet access to root user in solaris10

Commented out following line in /etc/default/login file
#CONSOLE=/dev/console

Solaris Installation

following methods you can install sun solaris on your PC
Solaris Installation Method
1. Install one system from CD/DVD media
2. Install one system from LAN
3. Automate the installation (Custom Jumpstart)
4. Replicate same software& configuration to multiple systems (Solaris Flash archives)
5. Install system over WAN or Internet (WAN Boot)
6. Upgrade a system while it is running (Solaris Live Upgrade)
7. After installation created an isolated application environment.(Solaris zones)

Minimum Hardware Requirements
Processor: SPARC 200 MHz or higher X86 120 MHz or higher
RAM: 64 to 512MB (Based on installation type you should have required RAM)
HDD space: 2 to 7GB

we can download opensolaris from following location
http://opensolaris.org/os/downloads/

Sun Solaris Introduction

SUN Solaris

It is an Operating system.
SUN => Stanford University Network

Sun Microsystems Founders (1982)
Scott Mcnealy,
Bill Joy,
Vinod kosla

Supported Platform: SPARC, x86, x86-64


Support:
Solaris 7 -No longer shipped -supported until Aug2008
Solaris 8 - from Feb07 stopped shipping - supported until April2012


Versions
First Version: Solaris 1.x (1991)
Latest Version: Solaris 10 (2005)
for more details about sun releases Versions