8. SOLARIS ADMINISTRATION

SOLARIS - MISC

Note = Solaris MICS CMD etc etc

      Solaris Common Command Line And Others Issue

Configuration Setup

1

  Solaris useradd "normal"

bash-3.00# useradd -d /export/home/routers -m -s /bin/bash -c "Routers NOC" routers


2

  Solaris 11 Multi useradd "Scripted" autosh.sh + userlist.txt

#!/bin/ksh
     
    # changeme as default
    # Adds users from the userlist.txt file if they are not in
    # /etc/passwd.
    #
     
    CURRENTUSERS=`awk -F":" '{ print $1 }' /etc/passwd`
    EXPECTEDUSERS=`cat userlist.txt`
    USERFOUND=0
     
    for i in $EXPECTEDUSERS ; do
            for x in $CURRENTUSERS ; do
                    if [ "$x" = "$i" ] ; then
                            USERFOUND=1
                    fi
            done
            if [ $USERFOUND -eq 1 ] ; then
                    echo Found user: $i
                    USERFOUND=0
            else
                    /usr/sbin/useradd -d /export/home/$i -g staff $i
                    echo Adding user: $i
                    sed s/$i:.*:.*:.*:.*:.*:.*:.*:/$i:XOHWcSkDQKZaA:14208:0:99999:7:::/g </etc/shadow>/etc/shadow2
                    cp /etc/shadow2 /etc/shadow
                    rm /etc/shadow2
            fi
    done
     
    exit 0

user1
user2

3

  Solaris 10 Resetup Network / host configuration

# /usr/sbin/sys-unconfig

4

  Solaris Mount .iso / Mount Linux DIsk "rmformat"

bash-3.00# lofiadm -a /export/home/rou/linux.iso
/dev/lofi/3
bash-3.00# mkdir /mnt/3
bash-3.00# mount -o ro -F hsfs -o ro /dev/lofi/3 /mnt/3

bash-3.00# mount -F ext2fs    /dev/dsk/c5t0d0p1 /mnt/usb

5

  Solaris SSH Slow

bash-3.00# echo  "LookupClientHostnames no" >> /etc/ssh/sshd_config
bash-3.00# svcadm restart ssh


6

  Solaris SMF

bash-3.00# svcs    -a |grep smtp
online         20:23:57    svc:/network/smtp:sendmail
bash-3.00# svcadm disable svc:/network/smtp:sendmail
bash-3.00# svcs    -a |grep smtp
disabled       13:59:53    svc:/network/smtp:sendmail


7

  Solaris Ping OK Browser Not Work

root@sol-11web:~# svccfg
svc:>  select name-service/switch
svc:/system/name-service/
switch> setprop config/host = astring: "files dns"
svc:/system/name-service/
switch> select system/name-service/switch:default
svc:/system/name-service/
switch:default> refresh
svc:/system/name-service/
switch:default> validate
svc:/system/name-service/
switch:default> exit
root@sol-11web:~# svcadm refresh name-service/switch
root@sol-11web:~# ping google.com

8

  Solaris NIC Plumb



9

  Solaris Hardware Error Checking

root@sol-11:~# prtdiag -v


10

  Solari 10 Activate 2nd NIC start at Boot

bash-3.00$ cat  /etc/hostname.qfe0
0.0.0.0
up


11

  Solaris IP Route CMD

root@sol-11:~# route delete default 192.168.1.1
root@sol-11:~# route add default 192.168.1.11

root@solaris:~# ipadm create-addr -T static -a 103.28.88.121/26 net1
root@solaris:~# route -p add default 103.28.88.65

12

  Solaris 11 Root Recovery

append -s in kernel line in grub, then user root just enter empty, change pass with passwd and reboot


13

  Solaris 11 Deactivated Slow Keyboard

Press and Hold Sift key for 8 second

14

  Solaris Flash Player

root@sol-11:~# cp libflashplayer.so /usr/lib/firefox/plugin
root@sol-11:~# chmod -R 755 /usr/lib/firefox/plugins


15

  Solaris OpenOffice Setup

login root gui - edit /etc/user_attr , root to normal then login as root

root@sol-11:~# /usr/bin/java -DHOME=/root -jar JavaSetup.jar

16

  Solaris 10 Sparc

To obtain > ok
           Sun keyboard STOP + A
           PC keyboard  Ctrl + Shif + Pause


17

  Solaris Memory and CPU Checking

root@sol-11:~# /usr/sbin/prtconf | grep Memory
Memory size: 3933 Megabytes

root@sol-11:~# /usr/sbin/psrinfo -v
Status of virtual processor 0 as of: 12/02/2012 21:02:49
  on-line since 12/02/2012 09:04:52.
  The i386 processor operates at 2001 MHz,
    and has an i387 compatible floating point processor.
Status of virtual processor 1 as of: 12/02/2012 21:02:49
  on-line since 12/02/2012 09:04:58.
  The i386 processor operates at 2001 MHz,
    and has an i387 compatible floating point processor.

18

  Solaris Extra Repo / Publisher

root@sol-11:~# pkg set-publisher -p http://pkg.openindiana.org/sfe
pkg set-publisher:
  Added publisher(s): sfe
root@sol-11:~# pkg set-publisher -p http://pkg.openindiana.org/sfe-encumbered
pkg set-publisher:
  Added publisher(s): sfe-encumbered

root@sol-11:~# pkg install vlc

19

  Solaris From Text Install Desktop

root@sol-11dev:~# pkg install --accept  slim_install
           Packages to install: 628
           Mediators to change:   1
       Create boot environment:  No
Create backup boot environment:  No
            Services to change:  17

root@sol-11dev:~# pkg uninstall  slim_install
root@sol-11dev:~# svcadm enable svc:/application/graphical-login/gdm:default

20

  Solaris HjSplit Java - Join file.001 file.002

noc@sol-11:~$ /usr/bin/java -jar hjsplit_g.jar


21

  Solaris 11 Boot Menu & Dual boot Linux "menu.lst w/seq Linux 1st & Solaris 2nd

root@sol-11:~# bootadm list-menu
the location of the boot loader configuration files is: /rpool/boot/grub

title Centos Grub
rootnoverify (hd0,0)
makeactive
chainloader +1

22

  Solaris 11 SSH Failed Login LOG

root@sol-11web:~# nano -w  /etc/default/login >>
 SYSLOG_FAILED_LOGINS=0

root@sol-11web:~# touch /var/adm/authlog
root@sol-11web:~# chmod 600 /var/adm/authlog
root@sol-11web:~# chgrp sys /var/adm/authlog
root@sol-11web:~# nano -w -S /etc/syslog.conf
auth.notice <Press Tab> /var/adm/authlog
root@sol-11web:~# svcadm refresh system/system-log

23

  Solaris



24

  Solaris



25

  Solaris



26

  Solaris



27

  Solaris



28

  Solaris



29

  Solaris



30

  Solaris




Previous Section    SOLARIS ADMINISTRATION Next Section