Table of Contents
1. AIX
1.0 General concepts
1.1 SMIT, system administration
1.2 Backups, tape
1.3 Memory and process management
1.4 Shells, commands, man pages, InfoExplorer
1.5 Video, Graphics, X11
1.6 Networks and communications
1.7 LVM
1.8 AIX 4.x
1.9 Miscellaneous
HTML-ized and updated: Fri Oct 1 10:41:04 EDT 1999
General Info about this FAQ
This posting contains frequently asked questions and answers about the IBM RS/6000 series workstations and AIX versions 3 and 4. All input is very welcome, The list is split into five articles to pass thru most mailers. I’ll usually try to post them once a month to comp.unix.aix, news.answers, and comp.answers. Please let your input continue as I am most thankful for all of it.
Please make a note of the fact that these sites contain more than just the AIX FAQ and would probably be worth consulting before you post questions to any of the usenet groups. If you see a From: line it means that whatever follows is either an unabridged or slightly edited version of the input I have received, and that I may not have verified its contents. If there is no From: line, I probably know what I am talking about, and the entry is edited from various sources. All entries are numbered with major and minor subject number, e.g. 2.11. If the subject is preceded by an asterisk, that entry has been changed or added since the last posting. The comp.unix.aix group is for AIX on all IBM platforms -- RT, PS/2, 370, RS/6000 and mainframes (ESA based on OSF/1), but the traffic has evolved to discuss predominantly AIX 3.x and the RS/6000. The newsgroups comp.sys.ibm.pc.rt and comp.sys.ibm.ps2.hardware cover the RT, mostly hardware and AOS 4.3, and on PS/2 hardware respectively. Mark Whetzel posts FAQ lists about RTs in the rt and *.answers groups. There are few to non-existent discussions on AIX/370 and AIX/ESA.
If you post questions to comp.unix.aix, please be sure to indicate: the machine type and brief configuration, e.g. Model 540, 64 MB RAM, 48 MB swap space (this is actually bad), 1.2 GB XYZ hard drive, etc. Note: There are now three classes of RS/6000s - the original, RS or POWER, RS/2 or POWER2, and PowerPC. the exact AIX version number, i.e. AIX 3.1 is NOT sufficient, whereas AIX 3.1.5 or AIX 3.1 with the 3005 update is. With 3.2 you should mention any significant ptfs using the U4xxxxx numbers. I am doing this on my own time. Please do not ask me questions that should be asked to IBM. If you suspect you have software defect problems call IBM-SERV. If you have hardware problems call IBM-SERV.
1.0 General concepts
Subject: 1.000: The AIX operating system - what is it?
This is best answered by reading the text files in /usr/lpp/bos. The README file there contains general information and the bsd file contain useful information if you know BSD and/or System V. The last release for the RT PC is 2.2.1. The latest release for PS/2s
and Intel architecture machines is AIX 1.3; for PS/2s only, 1.2.1. For the RS/6000, there are three major levels, 3.2, 4.1, 4.2, and various intermediate levels. IBM has dropped support for 3.1. For those who don’t have a copy of /usr/lpp/bos/README or bsd, I’ll sumarize: IBM tried to follow IEEE, POSIX 1003.1, ANSI C, FIPS and then X/Open Issue 3. Beyond that, AIX is a combination of System V and BSD.
------------------------------
Subject: 1.001: I know neither Unix nor AIX
- where do I find more information?
If you are new to Unix, you should look at the other newsgroups in the comp.unix hierarchy, in particular comp.unix.questions. There are FAQs more most of these groups as well. If you need information about C programming, try comp.lang.c or comp.std.c, the latter for Standard ANSI C issues. comp.lang.c has a FAQ posting.
------------------------------
Subject: 1.002: What is the Object Database?
AIX stores most of the system management information in /etc/objrepos, /usr/lib/objrepos, and /usr/share/lib/objrepos. Files (also referred to as system object classes) in these directories are adminstered by the Object Database Manager, ODM, which is a set of library routines and
programs providing basic object oriented database facilities. Under most circumstances, only SMIT or the commands SMIT call (see 1.100) should be used to change the contents of the system object classes. A harmless way to look at the object database is to use odmget
------------------------------
Subject: 1.003: How do I get rid of the verbose error messages?
Many of the messages from the Unix commands are available in different languages. This is controlled by the LANG environment variable, the default being En_US meaning English in the US. All the default messages have a message number associated with them, e.g.: $ cat no-such-file cat: 0652-050 Cannot open no-such-file. If you prefer the terser Unix-looking error message, set your environment variable LC_MESSAGES to C, and you will get: $ cat no-such-file cat: Cannot open no-such-file. By default LC_MESSAGES is the same as your environment LANG. Setting LANG does also work, but should be avoided since it changes app-defaults lookup etc. See locale(): LC_ALL
------------------------------
Subject: 1.004: Which release of AIX or other products do I have?
New with 3.2.5: The oslevel command shows OS and component levels.
Run oslevel -help to see options
The command ’lslpp -h bos.obj’ will show all lines referring to the BOS, Basic Operating System. E.g.: Fix Id Release Status Action Date Time User Name
------- --------------- --------- ---------- ---------- -------- ---------
Path: /usr/lib/objrepos bos.obj
03.02.0000.0000 COMPLETE COMMIT 12/31/69 18:00:00 root
U401864 03.02.0000.0000 COMPLETE COMMIT 11/12/92 20:09:35 root
U401968 03.02.0000.0000 COMPLETE COMMIT 11/12/92 23:18:21 root
U401969 03.02.0000.0000 COMPLETE COMMIT 11/12/92 23:18:20 root
U418349 03.02.0000.0000 COMPLETE COMMIT 08/28/93 15:34:13 root
U419950 03.02.0000.0000 COMPLETE COMMIT 08/28/93 15:34:11 root
For AIX 3.2, you may come across discussions on 3.2.0, 3.2.1, 3.2.2, 3.2.3 extended, 3.2.4 and 3.2.5. There is no absolute way to tell which of these you are running since the newer releases are simply 3.2.0 with some sets of PTFs added. See above example listing. These selective fixes could mean there are literally thousands of slightly different variations of 3.2 in use. Please see section 6 to request some useful faxes to help with this number game.
AIX 3.2.4 and later attempts to resolve this confusion. The OS is broken down into subsystems so that updates can be applied to an entire subsystem. lslpp also sports a new option; use ’lslpp -m bos.obj’ to show what level and update the system is running. You can also use the new oslevel command. Unless you have a pressing need (such as applications unsupported on > 3.2.3), it is recommended that you update to this level. Also see 1.128.
------------------------------
Subject: 1.005: What hardware do I have? What is availible? WITS?
The wits script is unfortunately no longer maintained. I just don’t have the time, and I’m not sure it is a realistic proposition anymore. There are so many different models that have the same model-ID that it’s impossible to be "definitive." [Editor’s note: I’ve deleted the source to the wits program from the FAQ,but it is listed as being part of the aix.tools.1.3.0.0.exe archive at Bull’s freeware download site
------------------------------
Subject: 1.006: Is IBM "dropping" AIX? AIX 3 discontinued.
No. IBM sells and supports AIX 4. However, on January 31, 1997 IBM will "withraw AIX 3.2.5 from marketing." That is, you won’t be able to purchase AIX 3.2.5 anymore. On December 31, 1997, IBM will "discontinue Program Services" for AIX 3.2.5. Translation: they will no longer respond to (most) defect reports for AIX 3.2.5. The US announcement letter can be read via
------------------------------
1.1 SMIT, system administration
Subject: 1.100: I am used to Unix systems programming, why should I learn SMIT?
Using SMIT is probably very different from your normal way of doing system administration, but could prove very useful in the long run. In some areas, in particular TCP/IP, NFS, etc., you can also do things the normal way, but it is unfortunately difficult to know exactly when the normal way works. Again, always using SMIT is probably your best way
to go, even when you have to learn a new tool. What SMIT actually does is build up commands with all required options to perform the functions requested and execute them. The commands called and the output they produce are stored in the files smit.script and smit.log in your home directory. Looking in smit.script may teach you more about system administration.
------------------------------
Subject: 1.101: How do I turn off the "running man" in smit?
Use smitty, the standard curses version or add this line to your .kshrc file: alias smit="smit -C"
------------------------------
Subject: 1.102: How do I import an /etc/passwd or /etc/group file from another box?
If the other box is non-AIX, copy the password and group entries for the non-system users into AIX’s /etc/passwd and /etc/group files. Then run /bin/pwdck -t ALL. This will create the proper entries in the shadow password file (/etc/security/users). You should also run usrck and grpck. To duplicate the password and group entries from another AIX box, copy /etc/passwd, /etc/group, /etc/security/passwd, /etc/security/group, /etc/security/user, /etc/security/limits, /etc/security/environ. The last three are optional unless you modified them. If you modified /etc/security/login.cfg, you should also copy that file.
------------------------------
Subject: 1.103: Cleaning up utmp, who, and accounting problems
The best way to fix this problem is to fix the programs which are causing the behavior in the first place. The short answer is to call software support and ask for the "UTMPFIX" collection of PTFs. Virtually all of these problems should be fixed in the 3251 PMP and the only one I’ve been able to prove is still broken is using ALT-F4 to close an aixterm. This applies if you are running an X11R5 xterm on 3.2. Add this to the top of X11R5 mit/clients/xterm/main.c:
#ifdef AIXV3
#define USE_SYSV_UTMP
#define HAS_UTMP_UT_HOST
#define WTMP_FILENAME "/var/adm/wtmp"
#endif
And your utmp problems should go away. If you want xterminal sessions to go into the wtmp file you need to define -DWTMP in the Imakefile and be sure the WTMP_FILENAME is set to the right place. Section 8.02 contains a small C program that you can use until the PTFs arrive. The program must be run as root and will periodically clean up old entries. Another utmp program was posted to comp.sources.unix, volume 25, issue 96 by David W. Sanderson that also works on AIX 3.1.
------------------------------
Subject: 1.104: How to fsck the root filesystem
You can run fsck either in maintenance mode or on mounted filesystems.
Try this:
1. boot from diskette (AIX 3 only --- AIX 4 boot from CD or tape)
2. select maintenance mode
3. type /etc/continue hdisk0 exit (replace hdisk0 with boot disk if
not hdisk0)
4. fsck /dev/hd4
------------------------------
Subject: 1.105: How can I unmount /usr to run fsck on it?
In order to fsck /usr, it has to be unmounted. But /usr cannot be unmounted because /bin is symbolically linked to /usr/bin. Also /etc/fsck is symbolically linked to /usr/sbin/fsck. To work around this, when you boot from the boot/maintenance diskettes and enter maintenance mode, enter "getrootfs hdisk0 sh" instead of "getrootfs hdisk0" where hdisk0 is the name of the boot disk. Then run "fsck /dev/hd2".
------------------------------
Subject: 1.108: How do I see/change parameters like number of processes per user?
You can use SMIT as described below or simply use lsattr/chdev. The former will list the current setting as in:
# lsattr -E -l sys0 -a maxuproc
maxuproc 40 Maximum # of processes allowed per user True and you can then increase the maxuproc parameter:
# chdev -l sys0 -a maxuproc=200
sys0 changed
If you just type ’lsattr -E -l sys0’ you will get a list of all parameters, some of which can be changed but not others. If you want to use smit, do as follows: smit
System Environments and Processes
Change / Show Operating System Parameters
- on this screen you can change by overtyping the following fields:
- Maximum number of PROCESSES allowed per user
- Maximum number of pages in block I/O BUFFER CACHE
- Maximum Kbytes of real memory allowed for MBUFS
- toggle fields exist for:
- Automatically REBOOT system after a crash (false/true)
- Continuously maintain DISK I/O history (true/false)
Info 1.30 erroneously suggests that in AIX 3.2.5 you can set different limits for different users.
------------------------------
Subject: 1.109: How do I shrink the default paging space on hd6?
1) create a paging space to use temporarily
mkps -s 20 -a rootvg
2) change default paging space hd6 so it is not used at next reboot
chps -a n hd6
3) For AIX 3.1, edit /etc/rc.boot4 and change swapon /dev/hd6; for AIX 3.2 and 4.x, edit /sbin/rc.boot and change swapon /dev/hd6 swapon /dev/paging00
3a)Since the default system dump device is /dev/hd6 in 4.1.x, it has to be changed to the temporary swap device before you remove the old swap device.
sysdumpdev -p /dev/paging00
4) Update information in boot logical volume
bosboot -a (3.1)
bosboot -a -d hdisk0 (3.2 & 4)
5) shutdown and reboot
6) remove current hd6 and create a new one of smaller size
rmps hd6
mklv -y hd6 -t paging rootvg
7) Re-edit /etc/rc.boot4 (3.1), /sbin/rc.boot (3.2) to swap to /dev/hd6
swapon /dev/hd6
7a)On AIX 4, change the dump device back to hd6:
sysdumpdev -p /dev/hd6
8) Update information in boot logical volume
bosboot -a (3.1)
bosboot -a -d hdisk0 (3.2 & 4.1)
9) change current paging device (paging00) so it is inactive at next boot
chps -a n /dev/paging00
10) shutdown, reboot, remove paging00 using the command:
rmps paging00
You can check your paging space with ‘lsps -a‘
------------------------------
Subject: 1.110: The swapper seems to use enormous amounts of paging space, why?
When you run ps, you may see a line like:
USER PID %CPU %MEM SZ RSS TT STAT TIME CMD
root 0 0.0% 14% 386528 8688 - S 17:06 swapper
This is normal behavior, the swapper looks to ps like it has the entire paging space plus real memory allocated.
------------------------------
Subject: 1.111: How much paging space do I need?
See answer 2 in question 1.300.
------------------------------
Subject: 1.112: How do I mount a floppy disk as a filesystem?
You can build a filesystem on a floppy and mount it, however the filesystem will be read only. The reason that the filesystem will be read only is because AIX Version 3.1.5 cannot create a journal log on a diskette. The intended use is for temporary access to read only data. The diskette file system must be unmounted after use and during system backup procedures or errors could occur. To make the read only filesystem on a floppy:
1. Make a subdirectory on an existing filesystem and place all of the files that the diskette will contain into this subdirectory.
2. Enter the following command to create a prototype file containing information about the new filesystem, in the example /dir_struct is the pathname of the subdirectory created in step 1, and proto_filename is the name of the prototype file to be created. proto /dir_struct > proto_filename
3. Place a formatted floppy into the drive.
4. Edit the prototype file and replace the first line with the following:
5. Enter the following command to make the filesystem on your floppy:
mkfs -p proto_filename -V jfs /dev/fd0
6. Create the directory upon which you will mount the floppy based filesystem, or you can use /mnt. Mount the filesystem:
mount -r -V jfs /dev/fd0 /your_mount_point
7. To unmount the filesystem:
umount /dev/fd0
Since the filesystem is read-only it may be of limited use but if you are going to use it for utility programs and other data that does not change much, it may still be useful. If you need to change the data, you can copy the directory from the floppy into another directory, make your modifications, and remake the filesystem using this procedure.
------------------------------
Subject: 1.113: How do I remove a committed lpp?
AIX 3.2.5: you can get rid of COMMITTED lpps/ptfs by installing with the force option and then rejecting the package.
AIX 4.1 users: installp has a new option, uninstall (-u) which can be
used to remove lpps.
------------------------------
Subject: 1.114: How can I recover space after installing updates?
Note: If you are a /usr server, do not use this because the files mentioned below are needed by /usr clients and cannot be deleted. Installp creates numerous files in /usr to clean up after failed/rejected installs and also for de-installing uncommitted lpps. Once you have COMMITted packages you can remove these files safely. Depending on your installation activity the numbers can be significant: hundreds-to-thousands of files, megabytes of data. Files eligible for removal are associated with each "product" you have installed; the largest collection being due to bos. After COMMITting bos lpps, you may safely remove all files of the form:
/usr/lpp/bos/deinstl*
/usr/lpp/bos/inst_U4*
/usr/lpp/bosadt/deinstl*
and /usr/lpp/bosadt/inst_U4*
You may repeat this for all additional COMMITted products (e.g., bostext1, bosnet, xlc) you have on your system. This problem of lingering install files is a known defect in installp. If you have installed PTF U411711 (or any superseder of it: U412397, U413366, U413425) the deadwood in /usr will not be quite as prevalent. No single PTF currently available completely corrects this problem. On my own 320, the following freed up 12.4M in /usr:
# rm -R /usr/lpp/bos/deinstl*
# rm -R /usr/lpp/bos/inst_U4*
------------------------------
Subject: 1.115: Where are the AIX log files kept?
AIX logs messages as specified in /etc/syslog.conf. Here’s an example
*.err;kern.debug;auth.notice;user.none /dev/console
*.err;kern.debug;daemon,auth.notice;mail.crit;user.none /var/adm/messages
lpr.debug /var/adm/lpd-errs
*.alert;kern.err;daemon.err;user.none operator
*.alert;user.none root
*.emerg;user.none *
for loghost machines, to have authentication messages (su, login, etc.) logged to a file, un-comment out the following line and adjust the file name as appropriate. if a non-loghost machine chooses to have such messages sent to the loghost machine, un-comment out the following line.
auth.notice /var/log/authlog
mail.debug /var/log/syslog
following line for compatibility with old sendmails. they will send messages with no facility code, which will be turned into "user" messages by the local syslog daemon. only the "loghost" machine needs the following line, to cause these old sendmail log messages to be logged in the mail syslog file.
user.alert /var/log/syslog
non-loghost machines will use the following lines to cause "user" log messages to be logged locally.
user.err /dev/console
user.err /var/adm/messages
user.alert ‘root, operator’
user.emerg *
------------------------------
Subject: 1.116: How can I log information about ftp accesses to a file?
1) In /etc/syslog.conf, add the line: daemon.debug /tmp/daemon.log
2) # touch /tmp/daemon.log
# refresh -s syslogd
3) Modify your inetd.conf so that ftpd is called with the "-l" flag. You may also want the "-d" flag. This can be done with ’smit inetdconf’. All the syslog messages from various system daemons should now appear in the file "/tmp/daemon.log".
------------------------------
Subject: 1.117: How do I find a file name from the inode number?
ncheck -i nnnn /mntpoint
------------------------------
Subject: 1.118: How do I set up postscript accounting?
Ephraim Vider originally wrote this program to configure postscript page accounting. It acts as a backend wrapper which logs accounting information in /etc/qconfig and can be ftp’d from utpapa.ph.utexas.edu in /pub/aix/psacct.tar.Z.
Compile with:
cc pswrap.c -o pswrap -lqb
and then make this program suid root:
chown root pswrap
chmod u+s pswrap
If this step is not done, the printer will hang.
Then start up SMIT and go to :
Spooler
Manage Local Printer Subsystem
Local Printer Queue Devices
Change / Show Characteristics of a Queue Device
2008年4月23日星期三
FAQ for IBM AIX
2007年7月19日星期四
index
How to mount a CD on different UNIX system
在不同的UNIX 系统 mount CD
How to mount a CD on different UNIX system
在不同的UNIX 系统 mount CD
on AIX
mount -o ro -v cdrfs /dev/cd0 /mnt/cdrom
umount /mnt/cdrom
on HP-UX
mount -r /dev/dsk/c2t1d2 /mnt/cdrom
umount /mnt/cdrom
on Linux
mount -t iso9660 -r /dev/cdrom/mnt/cdrom
umount /mnt/cdrom
on Solaris mount -F hsfs -o ro /dev/dsk/c0t6d0s2 /mnt/cdrom
umount /mnt/cdrom
on Tru64
mount -r /dev/disk/cdrom0c /mnt/cdrom
umount /mnt/cdrom
2007年6月1日星期五
Compare File Systems on Different Machines
怎样比较不同AIX机器的文件系统
When file systems that exist on different machines should be identical but you suspect one is damaged, you can compare the file systems. The following procedure describes how to compare the attributes of a file system that resides on your current host (in this scenario, called orig_host) to the same file system on a remote host.
Log in to the remote host as the root user. For example:
tn juniper.mycompany.com
AIX Version 5
(C) Copyrights by IBM and by others 1982, 2002.
login: root
root's Password:
Using your favorite editor, edit the remote host's .rhosts file to add a stanza that allows the root user to execute secure remote commands. Use the following format for the new stanza:
orig_host root
The resulting .rhosts file might look similar to the following:
NIM.mycompany.com root
nim.mycompany.com root
host.othernetwork.com root
orig_host.mycompany.com root
Save your changes and exit the remote connection.
With root authority on orig_host, create another file using your favorite editor. For this scenario, the new file is named compareFS. For example:
vi compareFS
Insert the following text in this file, where FSname is the name of the file system that you want to compare, and remote_host is the name of the host on which the comparison file system resides:
FSname -> remote_host
install -v ;
Note:
In the install command line of this file, there must be a space between the -v parameter and the semicolon (;).
For example:
/home/jane/* -> juniper.mycompany.com
install -v ;
Save the file and exit the editor. The compareFS file is used as the distfile for the rdist command in the following step.
Type the following at the command prompt:
/usr/bin/rdist -f compareFS
Or, if you expect a significant amount of output from the comparison, send the output to a file name. For example:
/usr/bin/rdist -f compareFS > compareFS_output
The output lists any differences between the file systems.
For More Information
The rdist command description in AIX 5L Version 5.2 Commands Reference.
The ".rhosts File Format for TCP/IP" in the AIX 5L Version 5.2 Files Reference.
"Understanding the Secure Remote Commands" in the AIX 5L Version 5.2 Security Guide.
AIX Security Checklist
详细的AIX 安全 Checklist
A. This info taken from AIX Redbook.
*************************
High level AIX security Audit Checklist
- AIX Environment Overview
- Superuser access
- Login/password administration
- Monitoring suid/sgid programs
- System/user file/directory permission
1. AIX Environment Overview
- Record serial numbers of all keys, remove keys and store in
safe location. Lock systems in NORMAL or SECURE.
- Run error logger to check the error log : errpt -a |more
- Enable accounting per instructions found in AIX System
Management Guide or aix.accounting file via anonymous ftp at
ftp.vt.edu: /pub/cc/rs6000.
- Run tcbck, usrck, grpck after all AIX software installations.
- The following scrips are available via anonymous ftp at ftp.vt.edu:
/pub/cc/rs6000.
- sysinfo
- This script determines system inventory.
- Determine rootvg names: lsvg
- List physical vols in each rootvg:
lsvg -p rootvg
- List logical vols in each rootvg:
lsvg -l rootvg
- List physical volume information for each
disk: lspv hdiskX
lspv -p hdiskX
lspv -l hdiskX
- List software inventory: lslpp -l
- List software history: lslpp -h
- List system name, name of node, LAN network number,
AIX release number, AIX operating system version,
machine ID number:
uname -x
- List all hardware connected to system:
lsdev -C | sort -d
- List NFS status
lssrc -g nfs
- List inet service: inetserv -s -S -X
- List host table entries: hostent -S
- List nameserver entries: namerslv -s -I
- List network status: netstat -i
netstat -nr
- Examine failed logins:
/usr/bin/who '-s' '/etc/security/failedlogin'
- Examine user group definitions:
/usr/sbin/lsgroup '-fa' 'id' 'users' 'ALL'
- Examine user information:
/usr/sbin/lsuser '-fa' 'id' 'groups' 'home' 'auditclasses' 'login' \
'su' 'rlogin' 'telnet' 'ttys' 'ALL'
- tcpchk
- This script checks the status of your tcp
subsystem. It also determines who's using
.netrc, .rhosts files.
- Determine the TCP subsystems installed:
- lslpp -l |grep bos.net
- lssrc -g tcpip
- Searches for .rhosts, .netrc files:
find / -name '.rhosts' -print
find / -name '.netrc' -print
- Searches for hosts that can use r-commands:
if [ -x /usr/sbin/inetd -a -f /etc/hosts.equiv ]; then
echo " the following hosts are allowed to rsh, rcp, rlogin"
echo
cat /etc/hosts.equiv | grep -v "#"
echo " "
fi
- Checks to see who can submit remote print jobs
if [ -x /usr/sbin/inetd -a -f /etc/hosts.lpd ]; then
echo " the following hosts are allowed to submit remote print jobs"
echo " ONLY"
cat /etc/hosts.lpd | grep -v "#"
echo " "
fi
- tcbck
- see man pages for more information
- nfsck
- This script checks the status of your NFS and
NIS subsystems
- Checks to see if nfs is installed:
lslpp -l |/bin/grep nfs
- Check to see if nfs/nis is active:
lssrc -g nfs|/bin/grep active
- Checks to see if this system is an NFS server:
if [ -x /usr/sbin/nfsd -a -f /etc/exports ]; then
echo "This machine is an NFS server"
- Displays which directories are exported:
cat /etc/xtab
- Displays hosts that are exporting directories:
/usr/bin/showmount
- If the host is a client, show what's mounted
from remote systems:
mount | grep -v "^ "
- Checks to see if nis is active:
isypset=`domainname | /bin/grep "^[a-zA-Z]"`
- If so, display the NIS domainname:
/usr/bin/domainname
- nethwchk
- Lists connected network interfaces:
lsdev -C -c if
- Show which ones come up at boot:
odmget -q"value='up'" CuAt|grep name|cut -c10-12
- Show interface status:
ifconfig en0
ifconfig et0
2. Superuser Access
- Keep root users to a minimum
- Do: lsuser -f ALL
to see which userids each user can use with su.
- Audit su command.
- Make sure /etc/profile doesn't include current directory.
- Verify cron setup:
To allow root only:
- remove: /var/adm/cron/cron.deny
&
/var/adm/cron/cron.allow
To allow anyone to use it:
- touch cron.deny if it does not exist.
To explicitly allow a user and no one else except root:
- touch cron.allow
- put userid in it
To explicitly deny a user:
- touch cron.deny
- put userid in it
- Disable direct logins for root by setting: 'User can LOGIN REMOTELY?
= false' in SMIT CHANGE/SHOW User Characteristics Screen.
3. Login/password administration
- Define password/user characteristics in /etc/security/user,
/etc/security/mkuser.default, /etc/security/login.cfg
- Minimum requirements (defined in /etc/security/user):
- maxage=8
- maxrepeat=2
- minalpha=5
- mindiff=2
- maxrepeats=3
- Set minimum default values for smit user field
(defined in /etc/security/user),
for the DEFAULT stanza:
- admin=false
- login=true
- su=false
- daemon=true
- rlogin=false
- sugroups=ALL
- ttys=ALL
- auth1=SYSTEM
- auth2=NONE
- tpath=nosak
- umask=027
- expire=0
- Scan for password inconsistencies:
- run /usr/bin/pwdck -n ALL to report errors but not fix them.
- run /usr/bin/pwdck -y ALL to fix errors and report them.
- Scan for group inconsistencies:
- run /usr/sbin/grpck -n ALL to report errors but not fix them.
- run /usr/sbin/grpck -y ALL to fix errors and report them.
- Review /etc/passwd, /etc/security/passwd, /etc/group and
/etc/security/group regularly.
- If systems are NIS'd, use 'ypcat passwd' to get passwd file
in standard format and then run CRACK against it to check
for weak passwords. Use npasswd for proactive checking. Run
CRACK regularly to check for weak passwords. Run COPS regularly.
- Consider requiring passwords from two users to access critical
accounts. When logging in such account, you'll be prompted
for the account passwd and another users passwd. Enable this
feature by specifying the second account in the PRIMARY
AUTHENTICATION METHOD field of SMIT ADD USER screen.
This sets up a two-person login.
- Set system-wide default process limits in
/etc/security/limits.
- Set default group, shell, home dir and other default
attributes for users in /usr/lib/security/mkuser.default. Consider
changing the default group name from staff to something local.
- Set default environment variables in /etc/environment,
/etc/profile and /etc/security/environ.
- CAUTION: when using NIS, the passwd file can be displayed
in standard unix format rather than in the shadow passwd
form. Make sure your NIS domain name is a well kept secret.
4. SUID/SGID
- Review all suid/sgid programs owned by root, daemon, bin or
groups: bin, kmem, mail. Initial list should contain owner,
group, perms and checksum. All suid/sgid programs should be
mode 511 minimum
- Use: find / -perm -1000 -print
find / -perm -2000 -print
find / -perm -4000 -print
alternatively to search for setuid, setgid and sticky bit files.
5. System/user file/directory permissions
- System dirs should have perm 755 minimum.
- System dirs used by root for programs should be owned by root.
- Set sticky bit on /tmp, /usr/tmp
- UUCP, cron table, syslogs, system source code should be
closed to general users.
- AIX default for /usr/sbin/mount, /usr/sbin/acct/acctcom and
/usr/sbin/login, login is 555.
- Monitor checksums for : login, su, passwd, cu, crypt, tip and
rlogin. Use /usr/bin/sysck command to do this.
- Only one copy of system commands and these should be in the
system dir.
- Device file perms:
disk, storage, tape, network device files: 600, owned
by root.
tty device files: 622, owned by root.
/dev/null: 777
- List all hidden files in dirs (the .files)
- List all writable dirs. Use find command to do this.
- User HOME dirs should be mode 710. Mode 711 allows others
to inspect subdirs with permission.
- .profile, .login files should be mode 600 or 640.
- Set appropriate umask in /etc/profile
- Search for unowned files: find / -nouser -print
Do not remove files from /dev.
- Check for 'at' jobs owned by root and verify their function.
- Restrict r-command usage.
1. Advise users to not use rsh, rcp, rlogin, tftp unless
you have secured them. Do not use .rhosts,
/etc/hosts.equiv or .netrc files.
2. Run securetcpip command to disable these services.
Use tcpchk script to search for .netrc files.
3. Set /etc/hosts to 660. Review its contents regularly. .netrc should never be
used because they contain unencrypted password info.
4. The securetcpip command disables non-trusted daemons and
appls. It comments out the entries in /etc/inetd.conf and sets perms to
000 for the individual daemons.
stopsrc -g tcpip
securetcpip
It disables rshd, rlogind, tftpd, rlogin, rcp, rsh, tftp, trpt. It is
reversible. Note that xstations may use tftp to download server code to
them.
5. Check .rhosts, .netrc, /etc/hosts.equiv, /etc/hosts and
/etc/inetd.conf regularly against checklist version.
6. Use netstat -p tcp to look for failed connection attempts.
7. Verify contents of /etc/exports and run exportfs -av
to implements the changes.
8. Change ftp entry in /etc/inetd.conf to ftpd -l to enable logging.
9. Set permission of exported dirs to be as limited as
possible. Do NOT export high level dirs unless necessary.
10. Enable AIX auditing [Optional]
Set instructions in /etc/security/audit/config, events, objects,
bincmds and streamcmds.
- Events - defines the occurrences to be audited.
- Use auditpr command to set,
- Audit classes are defined in config.
- Audit record formats are found in /usr/include/sys/audit.h
- Audit event types: per process - to audit each process a user
runs, per object - to audit object accesses and the mode of
access (r, Rw, success/fail). objects are defined in objects.
General Steps:
- Save original /etc/security/audit/events and config
files
- Modify config file to audit selected events
- Determine when to start auditing and the format
(bin or stream).
- Enter: audit start
to enable auditing.
- Review the output after a certain period of time
to make sure it's what you want.
11. Use the '/usr/sbin/watch' command to observe audit events for a program
you're not sure of.
12. Set up a separate account to do software installs. For example, define
it as acct swinstall.
13. Use the tsh command to run a trusted command interpreter. This
executes commands that are marked as members of the Trusted Computing
Base (TCB). The 'shell' command exits the tsh state.
14. Use Access Control Lists to tighten security on file:
- /usr/bin/aclget - shows status of file
- /usr/bin/acledit - allows you to change perm status
- /usr/bin/aclput - write status to file
setenv EDITOR /usr/bin/vi
AIX Terminology - base ACL is standard Unix permission stuff
Extended ACL is what these commands give.
SUID, SGID are same but SVTX = sticky bit
Any user can create an extended ACL for any file they own.
Three keywords:
permit - allows user/group access
deny - forbids user/group access
specify - defines the file access
Base permission CANNOT override a 'deny' keyword. User AND Group
must match.
15. List all files in your system:
cd /
li -Ra -l -a > filename
save the output off-line.
16. Check for failed logins by: /usr/bin/who -s /etc/security/failedlogin
17. Do not allow IFS (input field separator) to be changed in
/etc/profile and monitor its usage in user profiles.
18. Default AIX file permissions are 644 for files and 755 for dirs.
Adjust accordingly. AIX allows only root to use the 'chown' command.
- Set user profile files to 740
- System dirs should have other perms = 0
19. Keep track of these administrative files and archive as necessary:
- usr/adm/cron/log
- /usr/adm/wtmp
- /usr/adm/pacct
- /var/adm/messages
- /var/adm/acct/nite/*
- /var/adm/dtmp
- /var/adm/qacct
- /var/adm/acct/sum/*
- /var/adm/acct/fiscal/*
- /usr/bin/mail/*
- /etc/utmp
- /etc/security/failedlogin
20. Do not use UUCP unless absolutely necessary.
21. Use the '/usr/bin/strings' command to check any suspicious binaries.
22. Consider implementing disk quotas on your systems. See man pages for the
'quota' command.
23. Route copies of syslogs to a central machine. Edit /etc/syslog.conf
and do the following:
1. Add the following line:
*.debug @host
where host is the hostname of the central machine.
2. Place authentication messages in a separate syslog file, for
example, /var/adm/seclog:
auth.debug /var/adm/seclog
3. Place others in a file other than the standard AIX syslog
file, /var/adm/messages.
24. Archive system logs by creating a shell script that does the
following:
1. cd /var/adm
2. mv -f messages messages.old
3. cp /dev/null messages
4. chmod 644 messages
5. ps ax |grep syslog
6. kill -1 (syslog pid # from step 5)
7. move messages.old to the archive site.
note: make sure you use the name of the syslog file in these steps.
The name 'messages' is the standard AIX syslog name and if you
changed the default name (per step 23), make sure you use that name.