SSH

From CLONWiki
Revision as of 16:40, 29 December 2008 by Boiarino (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Do following ssh-related changes:

1. /etc/ssh/sshd_config (it will force execution of /etc/ssh/sshrc script which we'll create below; also every user's $HOME/.ssh/environment file will be processed):

PermitUserEnvironment yes

2. /etc/profile:

XAUTHORITY=/tmp/.Xauthority.$LOGNAME
export XAUTHORITY

3. Create /etc/ssh/sshrc with following contents:

HOME=/tmp
XAUTHORITY=$HOME/.Xauthority.$USER
export XAUTHORITY
if read proto cookie && [ -n "$DISPLAY" ]
then
      if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]
      then
              # X11UseLocalhost=yes
              echo add unix:`echo $DISPLAY |
              cut -c11-` $proto $cookie
      else
              # X11UseLocalhost=no
              echo add $DISPLAY $proto $cookie
      fi | /usr/openwin/bin/xauth -q -
 fi

(for Linux: /usr/X11R6/bin/xauth)

4. Create /root/.ssh/environment file with following contents:

XAUTHORITY=/tmp/.Xauthority.root

(DO NOT FORGET THAT ALL USERS MUST HAVE THAT FILE WITH CORRESPONDING CONTENTS !!!)

5. Restart ssh service by

svcadm restart network/ssh