Réf. : DISPLAY variable

steve.bernier at desjardins.com steve.bernier at desjardins.com
Wed Jan 23 13:41:38 EST 2002


We use this script with AIX and SUN.  script name: sussh.

if [[ `uname -s` = "SunOS" ]]
then
        XAUTH="/usr/X/bin/xauth"
else
        XAUTH="/usr/bin/X11/xauth"
fi

if [[ $DISPLAY = "" ]]
then
        echo "the Display must be defined\n"
        exit 1
fi

case $# in
  1) UID="$1" ;;

  *) echo "Usage: sussh usager"
     exit 1 ;;
esac
#
ARG=`${XAUTH} list $DISPLAY`
if [[ `grep $1 /etc/passwd | grep "/csh"` != "" ]]
then
        SHELL="/usr/bin/csh"
        echo "SHELL CSH sur DISPLAY=" $DISPLAY
        su - $UID -c "${XAUTH} add $ARG; setenv DISPLAY $DISPLAY; \
          setenv SSH_TTY $SSH_TTY; setenv SSH_CLIENT '$SSH_CLIENT'; $SHELL"
else
        echo "SHELL KSH sur DISPLAY=" $DISPLAY
        su - $UID -c "${XAUTH} add $ARG; DISPLAY=$DISPLAY; \
          SSH_TTY=$SSH_TTY; SSH_CLIENT='$SSH_CLIENT'; \
          export DISPLAY SSH_TTY SSH_CLIENT; $SHELL"
fi

Steve Bernier





Joe Zlomislic <Joe.Zlomislic at pwgsc.gc.ca>@sudo.ws on 2002-01-23 11:40:37

Envoyé par :   sudo-users-admin at sudo.ws


Pour :    sudo-users at sudo.ws
cc :
Objet :   DISPLAY variable

Hi All,

if there a way to pass the DISPLAY variable when you sudo to another user
i.e, oracle?  We have 5 dba's that sudo to oracle and the DISPLAY variable
is needed for running various GUI's.  Or do they have to set the variable
manually once they sudo to oracle?

thanks for any help,
Joe.
____________________________________________________________
sudo-users mailing list <sudo-users at sudo.ws>
For list information, options, or to unsubscribe, visit:
http://www.sudo.ws/mailman/listinfo/sudo-users








More information about the sudo-users mailing list