SUN SOLARIS Commands and Notes

 

SUN Solaris commands to change IPs

 

# ifconfig <interface> <ip_address> netmask <mask_address> broadcast <broadcast_address>

if your NT machine is 130.158.153.67 and the interface for your Solaris box is hme0,

# ifconfig hme0 130.158.153.68 netmask 255.255.255.0 broadcast 130.158.153.255

 

or use:

 

Put the new IP address into /etc/hosts next to the host name and then issue:

ifconfig <interface> <new_IP>

ie. if your interface is le0 and your new IP is 192.x.x.x then do:

ifconfig le0 192.x.x.x

 

and your done. If you're changing your IP class the you'll have to change the netmask as well. This can be done on the same line:

ifconfig le0 192.x.x.x netmask 255.255.255.0

 

ifconfig -a shows ip information for interfaces...

 

If you want to test default route dynamically add

this route "route add default x.x.x.x"

 

Or all the files:

 

The files which contain IP information are

/etc/nodename Contains the hostname of the machine

/etc/domainname Contains the NIS/NIS+ domainname

/etc/hosts Contains the host to IP database

/etc/hostname.<if> Contains the interface name to be matched in

/etc/defaultrouter Contains the default router IP address

/etc/resolv.conf Contains nameserver IP and DNS domain name

/etc/nsswitch.conf Contains database lookup rules

/etc/ethers Contains ethernet to hostname database

/etc/networks Contains netname to netIP database

/etc/netmasks Contains network to netmask database

/etc/inet/hosts

/etc/net/ticlts/hosts

/etc/net/ticots/hosts

/etc/net/ticotsord/hosts

 

Change the IP in /etc/hosts and reboot or use ifconfig.

 

Adding and modifying users

Cli:

useradd

usermod

userdel

 

passwd {user}

 

admintool          -creates users and passwords

or use the useradmin tool though the gui.

 

 

SUN partition table help:

 

Partitions needed for Solaris 2.6 (or5.6 pending on how you look at it)

            /                                   Size small

            /var

            swap                             Size, should be same as amount of memory

            backup or ???                Size, should be total drive space

            /home

            /usr

 

Disk Slot Number

 Logical Device Name

 Physical Device Name

 

Slot 0

 c0t0d0

 /devices/pci@1f,4000/scsi@3/sd@0,0

 

Slot 1

 c0t1d0

 /devices/pci@1f,4000/scsi@3/sd@1,0

 

# format /dev/rdsk/c0t5d0s2

selecting /dev/rdsk/c0t5d0s2

[disk formatted]

 

FORMAT MENU:

        disk       - select a disk

        type       - select (define) a disk type

        partition  - select (define) a partition table

        current    - describe the current disk

        format     - format and analyze the disk

        repair     - repair a defective sector

        label      - write label to the disk

        analyze    - surface analysis

        defect     - defect list management

        backup     - search for backup labels

        verify     - read and display labels

        save       - save new disk/partition definitions

        inquiry    - show vendor, product and revision

        volname    - set 8-character volume name

        quit

 

format> partition

 

PARTITION MENU:

I normally do a 'boot -r' from the ok> prompt .. another method is to

touch /reconfigure and reboot (via shutdown -i6 -g0 -y0) .. I've always

done it the first way though.

 

Bad magic # is coming up because the drives haven't been

formatted/labelled yet.  That should go away once you boot -r and

format/label them.

 

 

SUN general commands:

sun console settings:

9600-8-n-1

 

/etc/hosts          -hosts file

ps -e                 -shows all processes

who -a               -who's logged into system w/IDs

 

To get the terminal settings to display on a VT100 terminal:

            TERM=vt100,   then type export TERM, then everything should be lined up.

 

To install patches:

            get file to server with FTP, be sure to use BINary mode to transfer file to server

            if file is compressed (filename.tar.Z) use uncompress [filename]

            tar file:   tar -xf [filename]

            install the patch:   patchadd [filename]

 

Notes from install for IE and Netscape:

            default install locations:

                        /opt/netscape/netscape

                        /usr/local/microsoft/bin/iexplorer OR /opt/microsoft/bin/iexplorer

 

            Fix for IE bug with the registry settings:

                        copy /.microsoft directory into the home directory of user.

                        run iexplorer as root, two .bin files are created in /.microsoft--- 

                                    Copy these files into user home directory and chown them to that user.

                        Log off and login as user, should be good to go.

 

To create users use admintool.  Must be used in Desktop environment.

By default there are many accounts availible.  adm and root are default accounts.  root can't be used for telnet.  change password for adm and use it to telnet into box, then SU to superuser mode to pull up admintool.

 

stty erase [backspace]

 

DISPLAY=<localipnocarrets>:0

export DISPLAY

 

login command for solaris login for use with reflection x

using the telnet method...

(/usr/openwin/bin/xterm -fn 6x13 -sb -ls -display %IP#% -name %T% &)

 

 

init levels (for shutdown of machine)(need to be root)

init 0     shutsdown to firmware

init 5     shutdown machine so it's safe to kill power

init 6     reboots machine

 

To break boot sequence it's

[ctrl] + [break]

or even

[alt] + [ctrl] + [break]

 

find /etc -type f -print|xargs grep `hostname`

 

For install to occur, can stick CD in and ./installer -nodisplay to run the menu driven installer from CLI.

 

eject cdrom to eject cds...