You are on page 1of 3

Change hostname/IP address /etc/inet/hosts; /etc/auto_home

/etc/net/*/hosts; Automount home (indirect) map, sample as follow


Solaris Admininstror’s /etc/hostname.{hme0|le0}
/etc/nodename;
/etc/defautrouter;
/etc/resolv.conf
#### mount home directory #####
jialong bluebear:/export/home/jialong
Quick Reference
/etc/auto_direct
Author: Jialong He Setup Printer Automount direct map, sample as follow
Email: Jialong_he@bigfoot.com Local printer #### mount /usr/local from a server ####
http://www.bigfoot.com/~jialong_he lpadmin –p prt_name –v /dev/ecpp0 -D “description” –T PS /usr/local bluebear:/usr/local
-I postscript
User Initialization /etc/vold.conf
parallel port: {/dev/ecpp0 | /dev/bpp0} Volume manager configuration.
/etc/profile ($HOME/.profile) serial port: {/dev/term/a | /dev/term/b}
sh, bash, ksh system wide (per user) init share [options] pathname
Printer connected to a computer export NFS file systems to other computers.
(system wide init has no effect in CDE environment). lpadmin –p prt_name –s host_name –T unknow –I any mount [options] filesrv:/pathname /mnt
/etc/.login ($HOME/.login) Network capable printer
csh, tcsh system wide (per user) init Mount remote file system. For security, when possible, mount
lpadmin –p prt_name –m netstandard –v /dev/null system as readonly and nosuid.
(system wide init has no effect in CDE environment). -D “description” -o protocol={bsd | tcp}
$HOME/.cshrc /etc/rmmount.conf
-o dest=prtIP:9100 ? port needed for tcp protocol Removable disk configuration.
per user csh, tcsh init (order: /etc/.login ? $HOME/.cshrc ? -o banner={never | optional | always}
$HOME/.login). -o timeout=300
/usr/dt/config/Xsession.d/2000.login Sendmail Configuration
system wide init for CDE environment (a script in Xsession.d). /etc/mail/sendmail.cf
$HOME/.dtprofile Misc printing commands sendmail configuration file.
per user init for CDE environment. /etc/mail/aliases
/etc/skel/* lpadmin –d prt_name aliases file. Must run newaliases after modifying aliases file.
Templete files (local.cshrc, local.login, local.profile) copied to set prt_name as the default printer. Configure a mail server
new user’s home directory. lpstat –d Generate new configuration file
show current default printer. cd /usr/lib/mail/cf
lpstat –p prt_name –l cp main -v7sun.mc foo.mc
Network Configuration show prt_name configuration. /usr/ccs/bin/make foo.cf
/etc/defaultdomain lpstat –t
NIS/NIS+ domain name. show all printer status. Test new mail configuration file
/etc/defaultrouter /usr/lib/sendmail –C foo.cf –v email_address </de/null
IP address of the default router.
/etc/resolv.conf
Environment variables
Install configuration file
Internet domain name, name server and search order. cd /etc/mail
An example of resolv.conf LPDEST or PRINTER
User default printer. cp sendmail.cf sendmail.sav
domain la.asu.edu cp /usr/lib/foo.cf sendmail.cf
nameserver 129.219.17.200 _default in /etc/printers.conf
system default printer.
nameserver 129.219.17.5 pkill –HUP sendmail
search la.asu.edu asu.edu Anti -spam
/etc/nsswitch.conf Disable banner make sure FEATURE(access_db) is in sendmail.mc
specifying information source from files, NIS, NIS+, or DNS. edit file /etc/lp/interfaces/prt_name create /etc/mail/access with something like
/etc/hostname.{hme0|le0} nobanner=yes
Ipv4 hostname. cyberpromo.com REJECT
/etc/nodename Common setting stored in file sendmail.org RELAY
IPv6 hostname. /etc/lp/printers/prt_name/configuration spam@buyme.com 550 Spammers shan't see sunlight here
/etc/inet/hosts /usr/lib/lp/model
Host name file (/etc/hosts is a link to this file). makemap hash /etc/mail/access < /etc/mail/access
/etc/inet/netmasks
TCP/IP subnet masks. File Sharing
/etc/inet/protocols /etc/vfstab CDE configuration
Network protocols. File mount table (local or NFS). $HOME/.dtprofile
/etc/inet/services /etc/dfs/dfstab per user CDE init file, gemerated from
Network service name and port number. File sharing table (NFS server). /{usr|etc}/dt/config/sys.dtprofile.
/etc/notrouter /etc/auto_master $HOME/.dt/dtwmrc
create this file prevent in.routed or in.rdiscd from starting at Automounter master map, sample as follow desktop manager configuration file (pop-up menu when right
boot time. #### Master map for automounter #### click mouse). From /{usr|etc}/dt/config/C/sys.dtwmrc
/etc/inet/inetd.conf /home auto_home -nobrowse /usr/dt/appconfig/types/C/dtwm.fp
Internet super daemon configuration file. /- auto_direct -ro copy to $HOME/.dt/types/myname.fp and modify it.
$HOME/.dt/sessionetc /etc/pam.conf httpd.conf (https.conf)
per user CDE session start file (script with execute perm). pluggable authentication configuration file. Apache web server configuration file. (www.apache.org)
$HOME/.dt/sessionexit /etc/power.conf smb.conf
per user CDE exit file (script with execute permission). power configuration. Samba (window server) configuration file. (www.samba.org)
/{usr | etc}/dt/config/C/Xresources /etc/printers.conf
control attribute of login screen, for example, to disable session BSD printer configuration.
menu, uncomment following line
Miscellaneous Commands
/etc/magic
Dtlogin*session_menus*sensitive: False used by “file” command to determine file type. SUN patch files and freeware
http://sunsolve.sun.com
/{usr | etc}/dt/config/C/sys.resources /etc/security/*
session resource, for example, to disable automatic screen lock, security audit related files. http://sunfreeware.com
set timout to 0 Forget root password
/etc/syslog.conf
dtsession*lockTimeout: 0 system log daemon configuration file. boot –s cdrom
find out root partition with “format” command
$HOME/.dt/sessions/{current | home} /etc/notrouter
mount /dev/dsk/c0t0d0s0 /mnt (suppose c0t0d0s0 is root part.)
current (home) session files. specify this host is not a router.
edit /mnt/etc/shadow
/{usr | etc}/dt/config/Xconfig
configuration file for login screen (dtconfig), after change use Disable auto-logout feature for tcsh
Default info for various program Put following line in .cshrc or .tcshrc
dtconfig –reset
/etc/default/power unset autologout
/usr/dt/config/Xstartup
this script run after user login but before user session. power management parameters. edit /etc/inittab
/etc/default/Solregis remove sc:234:respawn:/usr/lib/saf/sac –t 300
/usr/dt/config/Xaccess
put DISABLE=1 to disable solaris registration screen. disable serial device (modem) login.
Control access to Xserver.
/etc/default/su showmount –e host_name
/usr/dt/bin/Xsession
start CDE session settings for “su” command. show export file systems on host_name.
/etc/default/sys-suspend rpcinfo –p host_name
/usr/dt/config/Xsession.d/*
users permitted to put system in suspend mode. check RPC services on host_name.
Scripts auto executed by Xsession.
/etc/default/passwd ldd program
usr/dt/config/Xsession.ow
start OpenWindow session. minimum password length. show what dynamic libraries needed by program.
/etc/default/login LD_LIBRARY_PATH is the search path for dynamic libraries.
/usr/dt/config/Xreset
login related settings, put CONSOLE=/dev/console useradd –d homedir –u UID –g GID –c “comment” –s shell
Command executed after the session end.
disable root login by telnet (rlogin). add new user account.
/usr/dt/bin/dtconfig –e|-d|-kill
-e|-d: enable (disable) autostart login server. /etc/default/init man foo | col –b > foo.txt
time zone, CMASK (default 022) save manual page for command “foo” in pure text.
-kill: kill dtlogin and all its child process.
/etc/default/kbd pkgadd –d pkgfile
$HOME/.dt/icons
KEYBOARD_ABORT=disable add solaris package file.
$/{usr|etc}/dt/appconfig/icons/C
default icons search path. boot –r
Reconfiguration system after adding new hardware.
Application Configuration who –r
System Configuration /etc/ssh2/ssh2_configure ($HOME/.ssh2/ssh2_config) show current run level.
SSH client system wide (per user) configuration file. volcheck –v
/etc/passwd, /etc/shadow, /etc/group
user account information. /etc/ssh2/sshd2_config ($HOME/.ssh2/sshd2_config) check if new floppy/cdrom is inserted.
SSH server system wide (per user) configuration file. fuser –u [ -k] /cdrom
/etc/ftpusers
users NOT allowed to use FTP. Setup SSH2 to accept hostbased authtication Show which program is using the cdrom (or floppy).
(1) Server side /usr/sbin/eeprom
/etc/system
Kernel parameters In sshd2_config, includes hostbased, like this show settings in eeprom.
AllowedAuthentications hostbased, publickey, password /usr/sbin/prtconf –vb
Example: disable execution in stack
In /etc/hosts, use client’s full qualified domain name (FQDN). show system information.
set noexec_user_stack=1
set noexec_user_stack_log=1 In .rhosts (.shosts), also use FQDN, make user these files are find / -type f –perm -4000 –user root –print
set maxuprc = 128 # maximum no. of user process owned by that user and not writeble by other users. find set UID to root program.
Copy client’s hostkey.pub to server’s /etc/ssh2/knownhosts and m64config –res 1024x768x75 –depth 24
set sys:coredumpsize = 0 # prevent core dump
name it as FQDN.ssh -dss.pub (e.g., bluebear.la.asu.edu.ssh- set screen resolution, color depth for M64 frame buffer.
/etc/hosts.equiv, ($HOME/.rhosts)
system wide (per user) trust hosts. dss.pub). (ffbconfig on Ultra -60)
(2) Client side fsck –F ufs –y /dev/rdsk/c0t0d0s0
/etc/motd, (/etc/issue)
In ssh2_config, includes hostbased authentication, like this file system check, answer “y” to all questions.
message after (before) login.
AllowedAuthentications hostbased, publickey, password xv –root –quit foo.gif
/etc/shells
allowed shell program. Also need to set DefaultDomain keyword, like set CDE screen background.
DefaultDomain la.asu.edu /etc/init.d/script {start | stop}
/etc/initab
run level configuration. run a script in /etc/init.d directory.
/etc/rc{S, | 1 | 2 | 3 | 5 | 6}.d /usr/local/lib/pine.conf newfs –v /dev/rdsk/c0t0d0s6
scripts for different run levels. system wide PINE configuration, overwrite by $HOME/.pinerc construct new file system after format.
/usr/local/lib/pine.conf.fixed /usr/sbin/sys-unconfi g
/etc/bootparams system wide PINE configuration, NOT overwrite by ~/.pinerc
rpc.bootparamd configuration file. reconfiguring the system.
patchadd [options] patch
apply patch to system.
ufsdump 0uf /dev/rmt/0 /
backup of all files.
ufsrestore xf /dev/rmt/0 etc/inetd.conf
restore inetd.conf file from backup
install_cluster –q -nosave
install recommended patch cluster.
ndd
set TCP/IP parameters
eeprom
change settings in eeprom, like
eeprom security-mode=full

Shell Programming
i f-then-else foreach do-while
sh, bash, ksh sh, bash, ksh sh, bash, ksh
if condition; then for key in list… ; do while condition; do
action_1; else actions; done actions; done
action_2; fi
csh, tcsh csh, tcsh
csh, tcsh foreach key (list) while (condition)
if (condition) then actions actions
action_1; end end
else
action_2; Rename files
endif foreach i (*)
mv $i $i.old
end