I originally published this script on my PeopleSoft Blog, but since it is as much Linux related, I thought it should go here, too.
The problem was that I was trying to install the Oracle Database via SSH using the GUI installer. The sudo command was breaking my X11 forwarding.
I found the answer on the “Bag of Tricks” blog:
Here’s my version:
</p> <p>#!/bin/sh</p> <p>user=$1<br /> if [ -z "$user" ]; then<br /> user=<default user><br /> fi</p> <p>displayNum=`echo $DISPLAY | sed -e 's/^.*://' -e 's/\.*//'`<br /> echo "Display # = $displayNum"<br /> cookie=`xauth list | grep ":$displayNum"`<br /> echo "Cookie = $cookie"<br /> cookiename=`echo $cookie | sed 's/\s*MIT-MAGIC.*$//'`<br /> echo "Cookie Name: $cookiename"<br /> echo "user = $user"<br /> sudo -u $user bash -c "xauth list; xauth add $cookie; bash; xauth remove $cookiename"</p> <p>