Solaris 10 Patch Where?

If you haven’t noticed, Solaris 10 is not available for free anymore. At least the patches. It’s Oracle after all.

Security patches were originally available for free when Sun stil exists but not anymore now. From PCA site:

Unlike before, even security patches are not available for free anymore.

So you’re screwed if you don’t have one. You’re better off installing OpenIndiana instead.

In case you’re one of the lucky folks (like me /hahahaha) having office Oracle account with Solaris support contract, I suggest checking out PCA to ease up installing patches. Also make sure to install it through OpenCSW for easiest update method.

User Management in Solaris 10

We’re back with Solaris 10 administration series. This time, it’s the user management part.

Securing the Password

For God knows why reason (probably legacy), the default password hashing algorithm in Solaris 10 is the classic UNIX DES hashing. To change it, edit /etc/security/policy.conf and find line starting with CRYPT_DEFAULT and change it to this:

CRYPT_DEFAULT=2a

(you can also set to other value but 2a should be good enough)

And to change the root password, first edit /etc/shadow and append $2a$ to the 2nd (password) field like this:

root:$2a$afgfdg....:...

or else chaning the root password using passwd won’t be set using the newly configured algorithm.

Creating User

First of all remember that there’s character limit of 8 for username in Solaris. Linux doesn’t have this but it’ll break ps (displaying UID instead of username). Also creating directory in /home is not possible because of several reasons. The proper way is to create home directory somewhere and create relevant entry in /etc/auto_home.

useradd -s /bin/bash newuser
mkdir -p /export/home/newuser
chown newuser:staff /export/home/newuser
printf "%st%sn" "newuser" "localhost:/export/home/newuser" >> /etc/auto_home
passwd newuser

This will let Solaris to automount (loopback filesystem/lofs) the actual directory (in this case /export/home/newuser) to /home.

Of course you can set the directory somewhere else, though having home not in /home feels weird.

Networking in Solaris 10

Since *BSD is getting boring, I decided to try an old but largely used enterprise OS: Solaris 10. I’m trying the latest update so it’s got ZFS and all the bling.

Anyway, I’m posting this so I can find this again whenever I need to.

Hostname/DNS

Here be hostname: /etc/nodename. Don’t forget to add relevant entries to /etc/hosts. And while at it, don’t forget to add loghost to 127.0.0.1 on hosts entry. Don’t forget to set /etc/nsswitch.conf with content of /etc/nsswitch.dns since unless you know what you’re doing, that’s what you want.

Static IPv4

/etc/hostname.if. Fill in with relevant IP address.

Static IPv4 Default Route

/etc/defaultrouter. Fill in with relevant default gateway’s IP address

Static IPv6

/etc/hostname6.if. Fill in with IPv6 address in following format:

addif some:ipv6:add::ress/prefixlen up

Also disable service for network discovery protocol (IPv6 routing etc autoconfiguration) by issuing

/usr/sbin/svcadm disable routing/ndp

Or not. It’s an undead zombie. Just add that line to /etc/rc3.d/S99rclocal (or create the file and make it executable if it isn’t there yet) to really kill the service upon boot.

Static IPv6 Default Route

It’s buried in /etc/inet/static_routes. Modified using route -p. Execute this for setting default IPv6 route:

route -p add -inet6 default de:fa:ult::gw

And that’s about it. It’s more or less same in Solaris 11 but you need to disable physical:nwam service in there. Also there’s ipadm but I think it’s still pretty much a black magic.

DHCP

For DHCP/dynamic, it is much easier:

touch /etc/hostname.if
touch /etc/hostname6.if
touch /etc/dhcp.if

Audio volume control from shell in OpenIndiana

I might be missing something but the volume control for OpenIndiana is a bit lackluster in display department compared to FreeBSD’s. In FreeBSD, whenever I do a volume change I get to see the values; before and after – but not in OpenIndiana; its default shell-based mixer quite sucks and doesn’t give enough feedback whenever I change volume.

There’s a good reason I keep bash as my main shell – I can script in POSIX sh and keep the sane shell at the same time (as opposed to using actual POSIX sh). So here’s the function I recently created; when given no parameter will display current volume and when given one parameter will change the volume and display how the change goes.

vol() {
getvol() { audioctl show-control volume | awk ‘/^volume/ { print $2 }’; }
printf “%s: ” “Volume”
if [ -n “$1” ]; then
printf “%s => ” “$(getvol)”
audioctl set-control volume “$1”
fi
printf “%sn” “$(getvol)”
}

It should be pretty much POSIX but remember that it will only work in Solaris Express 11 (probably) and OpenIndiana (tested with oi_148).

mplayer2 on openindiana

Some points:

  • Yes, it’s doable. Use mplayer2-build helper
  • You have to install many things (mainly autotools and don’t forget system audio header). Also yasm from opencsw
  • With regard to autotools, you have to create symlink for few things and put it somewhere in your PATH, preferably before everything else (namely ginstall -> install, aclocal-1.10 -> aclocal, automake-1.10 -> automake)
  • Add –cc=gcc to common_options

Probably there are some more but that’s all I can remember right now. Should also applicable for opensolaris (why are you still using it) and Solaris Express 11.

If you want to enable SSE support, you have to apply some patches to mplayer.

If you want to use vdpau while using nvidia’s latest driver, you have to install libvdpau.