Skip to content
raphaelcohn edited this page Dec 9, 2014 · 2 revisions

AIX Server Providers

IBM provide partners with access to AIX servers through the PartnerWorld program: IBM Power Developer Servers.

Miscellany

  • To find the operating system version, rather than use uname, use oslevel.
  • To administer the system, use smitty

AIX Toolbox for Linux

  • AIX Toolbox for Linux
    • Actual RPMS are on FTP!
    • Some come on the AIX image, eg /stage/middleware/AIX on AIX 7 on IBM's virtual loaner program
  • A superb independent source of far more modern builds is at perzl!
  • Bull also has a slightly more recent version of some of the RPMs in its toolbox
  • It is possible to install from FTP, eg rpm --install ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/bash/bash-4.2-3.aix6.1.ppc.rpm

Version gotchas

  • The AIX toolbox is very dated
    • RPM is version 3.0.5
    • bash is version 3.2

Tools gotchas

  • There is no less
  • There is no rsync
  • There is no mktemp!
  • There is no sudo
  • There is no git (but SCCS is still there).
  • sleep does not take a fractional seconds
  • The default shell is a bastardised ksh88 (there is ksh93 available)
  • History, backspace, etc don't work correctly, but do when bash is installed
  • chsh refuses to change shells to an installed bash, just vi /etc/passwd instead

Hacking PartnerWorld Images to usefulness

LOGIN_USER="$(whoami)"

# Change PATH
echo 'export PATH=/usr/linux/bin:"$PATH"' >>~/.profile

su -

printf '%s' "Please change the password for root: "
read -r PASSWORD
chpasswd <<EOF
root:$PASSWORD
EOF

echo "Installing bash"
rpm --install /stage/middleware/AIX/linux_tools/bash-3.2-1.aix5.2.ppc.rpm

PASSWORD_FILE=/etc/passwd
USER_SHELL=/usr/bin/bash

echo "Making bash the shell for root and $LOGIN_USER"
USER=root
awk -v SHELL="$USER_SHELL" -v USER="$USER" -v FS=: -v OFS=: '$1 ~ "^" USER "$" {print $1,$2,$3,$4,$5,$6,SHELL}; $1 !~ "^" USER "$" {print $1,$2,$3,$4,$5,$6,$7}' "$PASSWORD_FILE" >"$PASSWORD_FILE".tmp
cp -f "$PASSWORD_FILE".tmp "$PASSWORD_FILE"
rm "$PASSWORD_FILE".tmp

USER="$LOGIN_USER"
awk -v SHELL="$USER_SHELL" -v USER="$USER" -v FS=: -v OFS=: '$1 ~ "^" USER "$" {print $1,$2,$3,$4,$5,$6,SHELL}; $1 !~ "^" USER "$" {print $1,$2,$3,$4,$5,$6,$7}' "$PASSWORD_FILE" >"$PASSWORD_FILE".tmp
cp -f "$PASSWORD_FILE".tmp "$PASSWORD_FILE"
rm "$PASSWORD_FILE".tmp

echo "Installing rsync and curl"
rpm --install /stage/middleware/AIX/linux_tools/rsync-2.5.4-1.aix4.3.ppc.rpm
rpm --install /stage/middleware/AIX/linux_tools/curl-7.9.3-2.aix4.3.ppc.rpm

echo "Newer rsync 3"
rpm --install http://www.oss4aix.org/download/RPMS/rsync/rsync-3.1.1-1.aix5.1.ppc.rpm \
    http://www.oss4aix.org/download/RPMS/libiconv/libiconv-1.14-2.aix5.1.ppc.rpm \
    http://www.oss4aix.org/download/RPMS/popt/popt-1.16-1.aix5.1.ppc.rpm

echo "Newer OpenSSL (replaces 0.9.8x from 2007)! (perl.rte) must be installed"
rpm --erase openssl
rpm --install http://www.oss4aix.org/download/RPMS/openssl/openssl-1.0.1j-1.aix5.1.ppc.rpm

echo "Netcat (nmap and socat also available)"
rpm --install http://www.oss4aix.org/download/RPMS/netcat/netcat-1.10-2.aix5.1.ppc.rpm

exit

echo "Now ssh back in again"
exit