X forwarding through SSH in HP-UX

If you try to do X forwarding by SSHing to an HP-UX host, you may get the dreaded “Can’t get IP address for X11 DISPLAY.” error. This is more common than you might think, and the reason is that an out-of-the box installation of HP-UX has four or five /etc/nsswitch.conf *examples* for you to install, but not an actual /etc/nsswitch.conf file. I guess this is buried somewhere on the documentation — hey, it might even be a FAQ, but I guess that shipping with a reasonable default wouldn’t hurt.
Well anyway, the following minimal /etc/nsswitch.conf should do for the vast majority of scenarios I can imagine:

# echo “hosts: files dns” > /etc/nsswitch.conf

Now SSH X forwarding should work and a myriad other disasters waiting to happen will surely be averted.

Posted in General, SysAdmin Tagged with: , , , ,