Solaris 10 Admin
Solaris 10 Admin
ความรู ้พืน
้ ฐาน
Course: Fundamentals of Unix Solaris
Course: Intermediate System Administration for Solaris OE
Perform basic Unix tasks
Understand basic Unix commands
Use vi text editor
Interact with a windowing system
Solaris 10 Installation
Initialization, OpenBoot PROM, and Run Levels
Printer Management
Pseudo File Systems and Virtual Memory
System Logging, Accounting, and Tuning
Solaris 10 Installation
Initialization, OpenBoot PROM, and Run Levels
Category SPARC IA
System operation before OpenBoot PROM BIOS
kernel load Solaris Device Config
Assistant
MDB (Multiple Device
Boot)
Booting system Command Option at PROM Command Option at
MDB
Category SPARC IA
Boot Program bootblk (Pri. boot program) mboot (MBR)
ufsboot (Sec. boot program) pboot (Solaris Partition boot
load kernel program)
Bootblk (Pri. boot
program)
ufsboot (Sec. boot
program)
load kernel
Category SPARC IA
System Shutdown shutdown,init w/o shutdown,init w/ intervention
intervention
Disk slice and partition Max. 8 slices (0-7) DiskMax. 4 fdisk partition
Sol fdisk 10 slices (0-9) but
0-7 store data
Solaris 2.3 (SunOS 5.3) VFS,Online Backup, PAM, PPP, CacheFS (NFS), NIS+
Solaris 2.5 (SunOS 5.5) PAX,Soltice Admin Suite, Process Tool (/proc), Telnet client (4.4 BSD version),
Improve rlogind, telnetd
Solaris 2.5.1 (SunOS 5.5.1) UserID,GroupID extend to max. sign integer
Solaris 2.6 (SunOS 5.6) Printing Software (NIS,NIS+), Large file support (UFS,NFS, CacheFS), NFS
Kerberos use DES, RPC (GSS-API), Y2K compliance, WebNFS, JVM 1.1
Solaris 8 (SunOS 5.8) (10/00) IP Multipathing with NICs, WBEM (Web-Based Enterprise Management, Print USB
Solaris 8 (SunOS 5.8) (1/01) LDAP+iPlanet WebServer, SMC 2.0 (RBAC), WBEB (init.wbem, update security,
SMC Log viewer), USB (Sun Blade 100, 1000 and Sun Ray system)
Solaris 8 (SunOS 5.8) (4/01) New BIND, sendmail 8.10, IP multipathing with dynamic reconfiguration (DR),
Mobile IP (reverse tunnel)
Solaris 8 (SunOS 5.8) (7/01) PPP 4.0 (async,sync comm., PAP, CHAP), NCA (Solaris Network Cache
Accelerator), IP Multipathing (IPMP reboot safe)
Solaris 8 (SunOS 5.8) (10/01) DR 3.0 (Automated DR), USB (KB,Mouse,Printer,Audio)
Solaris 8 (SunOS 5.8) (2/02) RPC (Sun ONC+ async protocol)
Release Feature
Solaris 9 (SunOS 5.9) Resource Manager (allocate resource), Fixed-priority (FX), Web Start Flash
Install (master,clone), Live Upgrade, New option (df, du, ls, 1K unit), pargs
and preap (process debugging), NIS+ LDAP, Sun Internet FTP Server,
sendmail 8.12, Improve NCA, IPMP (link-up-down), Mobile IP (advertise
dynamic if), BIND 8.2.4, Solaris volume manager, SMC 2.1 (6 new tools),
smpatch, Solaris Secure Shell, cdrw (Write CD)
Solaris 10 (SunOS 5.10) X86/X64, SPARC
Solaris Container – Grid Container (Isolate App, Service, Allocate resource,
Increase resource utilization)
Solaris Secure Execution (File Integrity and Secure Execution, User&Process
Right Management, IP Filter Firewall, Cyptographic Service/Secure,
Enterprise Authentication – LDAP,PW,MD5,Kerberos,Smartcard)
Solaris Dynamic Tracing (easy to analyze, debug, optimize system, App in
Realtime, Patch Management)
Solaris Predictive Self Healing (Auto diagnostic, isolate recovery from H/W,
App fault)
Client/Server Networks
Remote Procedure Call (RPC) technology, NFS
Remote Method Invocation (RMI) technology, Java
Networking and Distributed computing
Key Concepts
SPARC Hardware
Scalable Processor ARChitecture (SPARC)
High-speed buses, Fast I/O performance
UltraSPARC (workstation, server)
PCI local bus, USB, SVGA
Key Concepts
Supported Platforms
Key Concepts
Intel Hardware
Devices Supported Under Solaris Intel
# /usr/platform/’uname –m’/sbin/prtdiag –v
check version of OpenBoot
Training Professional Center 67
OpenBoot Architecture Standard
1.X SPARC system
2.X The first Openboot PROM
3.X UltraSPARC
4.X 64-bits UltraSPARC
5.X Sun Enterprise 3500-3800 etc.
* After boot PROM initialize the system, the banner displays on the
console
/kernel/drv contains all of the device drivers that are use system
boot
/usr/kernel/drv used for all other device drivers
Run RC script
$> /etc/init.d/script1 [start | stop]
$> /etc/rc#.d/S10xxxx [start | stop]
$> /etc/rc#.d/K10xxxx [start | stop]
Inode # Inode #
# cd /usr/platform/i86pc/sbin
# eeprom
# prtconf
Solaris 10 Installation
Initialization, OpenBoot PROM, and Run Levels
3 - Up to design Both
4 - Up to design Both
5 /opt Hold App software added to the system Both
Hold OS command, run by users, document, system
6 /usr Both
program
7 /export/home Hold home folder from remote system Both
Contain the boot slice info at the beginning of Solaris
8 - Both
partition – enable boot from HDD
Provide area reserved for alternative disk block.
9 - Both
Alternative sector slice.
Caution:
The fmthard command cannot write a disk label on the unlabeled disk.
Use the format utility for this purpose
Check auto-mounting
# df –h
# cd /export/software
This process also creates a lost+found directory for ufs file system,
which is directory that is used by the file system check and
repair (fsck command) utility (1-10% of disk space)
# newfs –N /dev/rdsk/c0t0d0s7
where N = To view the file system parameter that you use to create a new file system
without
Stop+A = OK prompt
# umountall
# umountall –l
Error Message
Umount: file system name busy
- A program is accessing a file or dir in file system
- A user is accessing a file or dir
- A program has a file open
- The file is being share
System Security
File System Access Control
Role-Based Access Control
Users, Groups, and the Sun Management Console
Kerberos and Pluggable Authentication
Training Professional Center 202
Training Professional Center 203
Performing Solaris OE Package Administration
Introducing the Fundamentals of Package
Administration
Software packages
The /var/sadm/install/contents file
Freeware URL
http://sunfreeware.com
Command Line
# pkginfo [Package Name] check if exist.
# pkgrm [Package Name] remove package
# pkgadd –d [datastream, Path] [Package Name]
install package
Scanport
APP - FW
OS
Core
H/W
# cd /cdrom/cdrom0/Solaris_10/Packages
# ls –l Check package name
# pkgadd –d . SUNWns6m add packages
# pkginfo –l | more
# pkgrm SUNWns6m remove a s/w package
Training Professional Center 215
Spooling Packages and Remove Packages
Adding Package by using a Spool Directory
/var/spool/pkg
# ls -al /var/spool/pkg
Install package
# file filename check file type
# pkgadd –d [datastream, package]
# pkgadd –d top-3.6-xxxx
Following the steps of package installation
# ls /var/sadm/patch
Removing patches
# patchrm 10500-01
Edit Mode :
:q = quit from vi
:w = save to file
:r = read to file
:q! = force to quit (save?)
:w! = force write (read only?)
Man
# man man
Cat / More / less
# cat filename.txt
Head
# head filename.txt
Tail
# tail filename.txt
C Shell (/bin/csh)
มีขด ี ความสามารถสูงกว่า Bourne Shell
ใช ้ไวยากรณ์ของภาษาซี C-Programming
การเรียกใช ้ Shell
# /bin/sh หรือ /usr/bin/sh
# /usr/bin/bash
# /bin/csh หรือ /usr/bin/csh
# /bin/ksh หรือ /usr/bin/ksh
การออกจาก Shell
# exit
# echo $variablename
# echo $HOME
# echo $PATH
การกาหนดค่าตัวแปรแบบ Public
# Variable=Value
# export Variable
มีคา่ เท่ากับ
# Variable=Value; export Variable
C Shell
%> set prompt=“MyPrompt> ”
%> set path=($path /usr/bin /usr/java/bin)
\s = Shell name
\v = Version
\u = User id
\h = Hostname
\w = Working Directory
Training Professional Center 247
Bash Shell - Completion
Key – Tab
# bash
bash# cd /e [tab]
etc/ export/
bash# pr [tab]
pr prxxx pryyy przzz
Training Professional Center 248
Bash Shell – Session History
Key – Up / Down
# history [enter] (List history command)
# !หมายเลข [enter]
# !4 [enter]
# cd /t [esc][esc]
# cd /tmp
ดูรายการ
# history
ต ้องการร ันคาสัง่
# r [No of command]
# r 38
Training Professional Center 251
C Shell – Session History
เรียกใช ้งาน
# csh
%
ดูรายการ
% set history=10
% history
ต ้องการร ันคาสัง่
% ![No of command]
% !11
Training Professional Center 252
Introducing to Solaris Management Console
# smc &
SMC Service
# /etc/init.d/init.wbem status
# /etc/init.d/init.wbem stop
# /etc/init.d/init.wbem start
** Console / Terminal
** Slow loading…
Training Professional Center 253
Introducing to Solaris Management Console
่ ยวข
Check File ทีเกี ่ ้อง
File /etc/passwd
File /etc/shadow
Change Password
Login as root
# passwd userid
Environment/Profile user
Home directory
.profile (Bourne)
.bashrc (Bash Shell)
.cshrc (C Shell)
.kshrc (Korn Shell)
Link Files
# ln –s .profile .bashrc
# ln –s .profile myprofile
Link Directory
# ln –s /usr/bin /bin
Remove Link
# rm linkname
Host Information
# uname –a
# more /etc/release
# lpadmin
# lpq Network Printer
Network Printer
Printing
# lp –d HPLJ4050 –n 1 filename
Cancelling Printing
# lpstat –p HPLJ4050 Find request-id
# cancel [request-id]
DIFF Full D D D D
INC Full I I I I
# compress –f full.tar
full.tar.Z $> uncompress full.tar.Z tar xvf full.tar
320
กำรใช้คำสัง่ batch
Batch [-p project]
321
กำรอนุ ญำตให้ใช้ at และ batch
กาหนดได ้ทีไฟล ่ ์
/usr/lib/cron/at.allow
/usr/lib/cron/at.deny
การพิจารณาจะตรวจสอบที่ at.allow เป็ นหลักถ ้ามี
รายการผูใ้ ช ้อยู่ก็จะอนุ ญาตให ้ใช ้
่ งสองนี
ซึงทั ้ ้ าหนดเพือให
ก ่ ้อนุ ญาต หรือไม่อนุ ญาตให ้ใช ้
หมายเหตุ การใช ้ allow กับ deny ไม่สามารถกาหนด
่ น root
ให ้กับผูใ้ ช ้ทีเป็
322
รู ้จักกับ Crontab
# man cron
/usr/sbin/cron
# man crontab
# cd /var/spool/cron/crontabs
root
username
# cd /etc/cron.d
File cron.allow
File cron.deny
/var/spool/cron/atjobs/[jobid]
# at –m 1141
at> /tmp/echo.sh
CTRL-D
10 10 25 01 04 /tmp/echo.sh
10 10 25 1 4 /tmp/echo.sh
10 10 25 1 * /tmp/echo.sh
Mailbox of sendmail
# more /var/mail/[username]
log
Content
log
F/W
Syslog.conf
Syslog.conf
IAB RFC
Research Task Force Engineering Task Force
ร่างมาตรฐาน สนับสนุ น
IRTF IETF
IANA
a. b. c. d. f. g. i. j. l. m.
e. h. k.
“abc.com” “xyz.com”
Root hint Forwarder
S1 S4 Delegated DNS Delegated DNS S5
S2
192.168.9.0 / 24
203.151.100.1
203.151.100.0 / 24 192.168.1.0 / 24
Route add [NetworkID] [Gateway IP] Route add [NetworkID] [Gateway IP]
# route add 0.0.0.0 203.151.100.1 # route add 192.168.9.0 192.168.1.1
# route add default 203.151.100.1 # route add 192.168.9.9 192.168.1.1
Other tools
# ethereal &
# nmap
Package Installation
Get file lsof.4.74*local.gz
# gunzip lsof4.74.gz
# lsof4.74*local
# pkgadd –d lsof*local
/usr/local/bin
/usr/local/man
# man –M /usr/local/man lsof
192.168.9.1
Computer
192.168.1.2
192.168.2.0
365
Training Professional Center 366
บริกำร NFS
Data share
NFS Server
/mnt/data
/mnt/public
/data
/public
/home /mnt/data
/mnt/public
367
NFS (Network File System)
Server
Login as root
$> ps –ef | grep nfsd
$> mkdir /export/share
$> share –F nfs –o rw /export/share
/etc/init.d/nfs.server start
$> share Check sharing
$> dfshares Check sharing
Client
$> mkdir /export/share
$> mount –F nfs hostname:/export/share /export/share
$> mount Check mounting
$> df Check mounting
Server
# unshare /export/share
# /etc/init.d/nfs.server stop
/etc/passwd, /etc/shadow
Root
User1
/etc/passwd, /etc/shadow user3
root
User1
user2
Su username
/etc/passwd, /etc/shadow
root
User1
user2
Su username
/etc/passwd, /etc/shadow
root
User1
user2
Su username
Token-usera
token:-usera
srv Token:-computera
Token-computera
Nfs – support kerberos
Router
Firewall
AP
Support RADIUS Client
Wifi
Change
202.44.33.11 www.abc.com
202.44.33.11 s1.abc.com
Change
Computer
Computer Computer
192.168.1.55 local.domain
192.168.1.56 r1.domain
Computer 381
Computer Computer
Webmin and DNS
Installation
Get package from http://www.webmin.com
File webmin-1.310.tar.gz
# cd /usr/local
# gzcat /xxx/webmin-1.310.tar.gz | tar xvf –
# cd /usr/local/webmin-1.310
# ./setup.sh
Client Access
- Windows XP: Open IE
- Solaris: Open Browser
http://192.168.9.130:10000
NAS
NAS
Computer
Computer
392
Name Services - Solaris
NIS / NIS+
Network Information Service (Server)
DNS
Domain Name Service (Server)
LDAP
Lightweight Directory Access Protocol (X.500)
vs MS ActiveDirectory (X.500)
passwd user1
group
hosts 192.168.9.1 w1
YP DB YP DB
ipnode 192.168.9.2 w2
192.168.9.3 w3
192.168.9.4 w4
192.168.9.5 w5
192.168.9.6 s1
Telnet
Rlogin
SSH
# rup 192.168.9.130
20 Data
21 Control
/var/ftp/pub
ftp> help
ftp> get [filename] download
ftp> mget [filename *.*] multiple get
ftp> put [filename] upload
ftp> mput [filename *.*] multiple put
ftp> binary Binary file (exe, jpg, gif)
ftp> ascii Text file (txt)
ftp> prompt Toggle interactive mode
ftp> hash Show Progress print ‘#’
ftp> quit / bye
.php
.asp
.idc .htm, .html
.etc
httpServer httpClient
- Apache IE, Netscape, Opera
url
Firefox, Mozilla
Tcp 80
411
Solaris Web Server (Apache)
Start script file
/etc/rc3.d/S50apache [start|stop]
Configuration file
# cp /etc/apache/httpd.conf-example httpd.conf
# /etc/rc3.d/S50apache start
Check http running
# ps –ef | grep httpd
Web Browser
IE, Webbrowser
http://[hostname, ip address][:80]
137-139
My Network Places
SAMBA Configuration
SMB – Server Message Box (Microsoft)
This form allows you to synchronize the Unix and Samba user list.
When Samba is using encrypted passwords, a separate list of users
and passwords is used instead of the system user list. The list of
users not to convert can contain usernames, UIDs, group names
prefixed with an @, or UID ranges like 500-1000 or 500-
Components
DNS Server
Zone – Domain name
Record (MX – Mail Server, NS – Name Server, A – ServerIP)
Configuration file /etc/named.conf
DNS Client
# nslookup www.webmin.com
66.35.250.210
66.xxx.xxx.xx
http://www.google.com
DNS Client
# nslookup
> server 192.168.9.130
> serverA.training.net
> 192.168.9.149
# ifconfig –a
ethers: 00:00:00:00:00:00
IP: 192.168.9.10
MAC: MAC1
IP: ? Lease Time
MAC: MAC1
DHCP Client
# dhcpagent DHCP Client
# /etc/dhcp.[interfaceName]
# /etc/dhcp.pcn0
Training Professional Center 429
Tuning & Recognizing File Access Problems
SMTP lumplang.com
4
5
SMTP
POP3/IMAP4
1 [email protected]
khajorn
MIME
wichai
# echo $PATH
Borne/Korn Shell
PATH=$PATH:/sbin:/opt/sfw/bin:.
export PATH
# . [.profile] Full Path of profile
C Shell
setenv path ( $path /sbin /opt/sfw/bin . )
%> source [.cshrc] Full Path of profile
# which [command]
# whereis [command]
Show fullpath of command