This file is indexed.

/usr/share/doc/HOWTO/ja-html/Remote-X-Apps-7.html is in doc-linux-ja-html 2006.05.25-1.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE> Remote X Apps mini-HOWTO : $BJL$N%f!<%6(B ID $B$+$i$N(B X $B%"%W%j%1!<%7%g%s(B</TITLE>
 <LINK HREF="Remote-X-Apps-8.html" REL=next>
 <LINK HREF="Remote-X-Apps-6.html" REL=previous>
 <LINK HREF="Remote-X-Apps.html#toc7" REL=contents>
</HEAD>
<BODY>
<A HREF="Remote-X-Apps-8.html">$B<!$N%Z!<%8(B</A>
<A HREF="Remote-X-Apps-6.html">$BA0$N%Z!<%8(B</A>
<A HREF="Remote-X-Apps.html#toc7">$BL\<!$X(B</A>
<HR>
<H2><A NAME="s7">7. $BJL$N%f!<%6(B ID $B$+$i$N(B X $B%"%W%j%1!<%7%g%s(B</A></H2>

<P>root $BFC8"$NI,MW$J!"%0%i%U%#%+%k$J@_Dj%D!<%k$r<B9T$7$?$$$H$7$^$7$g$&!#$7$+$7!"(B
X $B%;%C%7%g%s$OIaDL$N%"%+%&%s%H$G<B9T$7$F$$$^$9!#;O$a$O4qL/$K;W$&$+$b(B
$B$7$l$^$;$s$,!"(BX $B%5!<%P$O%D!<%k$,%G%#%9%W%l%$$K%"%/%;%9$9$k$3$H$r5v$7$^$;$s!#(B
root $B$GIaDL$K2?$+$7$?$$;~$K!"$I$&$9$l$P2DG=$G$9$+!)(B
$B$=$7$F$I$&$9$l$P$3$NLdBj$r2sHr$G$-$^$9$+!)(B
<P>
<P>$B%f!<%6(B ID <CODE>clientuser</CODE> $B$G(B X $B%"%W%j%1!<%7%g%s$r5/F0$7$?$$$,(B X $B%;%C%7%g%s$O(B
<CODE>serveruser</CODE> $B$G5/F0$5$l$F$$$k$H$$$&!"0lHLE*$J>u67$K$7$^$7$g$&!#%/%C%-!<$N(B
$B%;%/%7%g%s$rFI$s$G$$$l$P!"$J$<(B <CODE>clientuser</CODE> $B$,%G%#%9%W%l%$$K(B
$B%"%/%;%9$G$-$J$$$N$+J,$+$k$O$:$G$9!#(B
<BLOCKQUOTE>
<CODE>~clientuser/.Xauthority</CODE> $B$O%G%#%9%W%l%$$K%"%/%;%9$9$k$?$a$N(B
$B@5$7$$%^%8%C%/%/%C%-!<$r4^$s$G$$$^$;$s!#@5$7$$%/%C%-!<$O(B
<CODE>~serveruser/.Xauthority</CODE> $B$K$"$j$^$9!#(B
</BLOCKQUOTE>
<P>
<H2><A NAME="ss7.1">7.1 $BF10l%[%9%H>e$N0[$J$k%f!<%6(B</A>
</H2>

<P>$B$b$A$m$s!"%j%b!<%H(B X $B$GF0:n$9$k$b$N$O!"0[$J$k%f!<%6(B ID $B$N(B X $B$G$bF1$8$h$&$K(B
$BF0:n$7$^$9(B ($BC<E*$K$O(B <CODE>slogin localhost -l clientuser</CODE>)$B!#(B
$B%/%i%$%"%s%H%[%9%H$H%5!<%P%[%9%H$,$?$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(B
<P>$BEvA3%Q%$%W$G%/%C%-!<$rEO$7$?$$$H$3$m$G$9!#;DG0$J$,$i!"(B<CODE>su</CODE> $B$O(B
$B$=$NI8=`F~NO$+$i%Q%9%o!<%I$rFI$b$&$H$9$k$N$G!"(B<CODE>su</CODE> $B%3%^%s%I$K%Q%$%W$GEO$9(B
$B$3$H$O4JC1$G$O$"$j$^$;$s!#$3$3$G$bET9g$N$$$$$3$H$K$O!"(B
$B%7%'%k%9%/%j%W%H$NFbIt$G$O(B
$B%U%!%$%k5-=R;R$r$$$8$j2s$9$3$H$,$G$-$^$9$N$G!"$3$l$,2DG=$K$J$j$^$9!#(B
<P><CODE>clientuser</CODE> $B$H(B <CODE>clientprogram</CODE> $B$r%Q%i%a!<%?2=$7HFMQ2=$7$?%9%/%j%W%H$r(B
$B=q$-$^$9!#FI$_$d$9$5$O>/$75>@7$K$7$F4h6/$K$J$k$h$&$K!"%9%/%j%W%H$r2~A1(B
$B$7$^$7$g$&!#0J2<$N$h$&$K$J$j$^$9!#(B
<P>
<BLOCKQUOTE><CODE>
<PRE>
#!/bin/sh

if [ $# -lt 2 ]
then echo "usage: `basename $0` clientuser command" >&amp;2
     exit 2
fi

CLIENTUSER="$1"
shift

# FD 4 becomes stdin too
exec 4>&amp;0

xauth list "$DISPLAY" | sed -e 's/^/add /' | {

    # FD 3 becomes xauth output
    # FD 0 becomes stdin again
    # FD 4 is closed
    exec 3>&amp;0 0>&amp;4 4>&amp;-

    exec su - "$CLIENTUSER" -c \
         "xauth -q &lt;&amp;3
          exec env DISPLAY='$DISPLAY' "'"$SHELL"'" -c '$*' 3>&amp;-"

}
</PRE>
</CODE></BLOCKQUOTE>
<P>$B$[$H$s$I$N>u67$G!"0\?"@-$HF0:n$K==J,$@$H9M$($^$9!#(B
$B8=:_Cx<T$,9M$($&$k7gE@$O!"(B<CODE>'$*'</CODE> $B$r;H$C$F$$$k$?$a!"(B
<CODE>command</CODE> $BFbIt$G%7%s%0%k%/%)!<%H$rMQ$$$k$H(B
<CODE>su</CODE> $B%3%^%s%I$N0z?t(B (<CODE>'$*'</CODE>) $B$,2u$l$F$7$^$&$3$H$G$9!#(B
$B$b$7B>$K$b$J$K$+?<9o$J4V0c$$$,$"$C$?$i!"Cx<T$K(B email $B$r=q$-Aw$C$F(B
$B$/$@$5$$!#(B
<P>
<P>$B%9%/%j%W%H$r(B <CODE>/usr/local/bin/xsu</CODE> $B$H$9$l$P(B
<P>
<BLOCKQUOTE><CODE>
<PRE>
xsu clientuser 'command &amp;'
</PRE>
</CODE></BLOCKQUOTE>
<P>$B$H$G$-$^$9!#(B
<P>
<P>$B%Q%9%o!<%I$r;H$&8B$j!"$3$l0J>e$=$&4JC1$K$O$G$-$^$;$s!#(B
$B$($(!"(B(<CODE>sudo</CODE>) $B$r;H$&J}K!$b$"$j$^$9$M!#$G$b$3$3$G$O07$$$^$;$s!#(B
<P>
<H2><A NAME="ss7.2">7.2 $B%/%i%$%"%s%H%f!<%6$,(B root</A>
</H2>

<P>$BEvA3!"(Broot $B$G$O$J$$%/%i%$%"%s%H%f!<%6$,(B root $B$GF0:n$9$k$3$H$bF1MM$K$G$-$^$9!#(B
$B$7$+$7!"(Broot $B$O$9$Y$F$N?M$N(B <CODE>~/.Xauthority</CODE> $B%U%!%$%k$rFI$`$3$H$,(B
$B$G$-$k$N$G!"(Broot $B$N>l9g$O$h$j4JC1$G$9!#%/%C%-!<$rAw$kI,MW$,$"$j$^$;$s!#(B
<CODE>DISPLAY</CODE> $B4D6-JQ?t$r@_Dj$7!"(B<CODE>XAUTHORITY</CODE> $B$,(B
<CODE>~serveruser/.Xauthority</CODE> $B$r8+$k$h$&$K@_Dj$9$k$@$1$G$9!#$D$^$j(B:
<P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
su - -c "exec env DISPLAY='$DISPLAY' \
                  XAUTHORITY='${XAUTHORITY-$HOME/.Xauthority}' \
                  command"
</PRE>
</CODE></BLOCKQUOTE>
<P>
<P>$B$3$l$r%9%/%j%W%HCf$K=q$/$H0J2<$N$h$&$K$J$k$G$7$g$&!#(B
<P>
<BLOCKQUOTE><CODE>
<PRE>
#!/bin/sh
if [ $# -lt 1 ]
then echo "usage: `basename $0` command" >&amp;2
     exit 2
fi
su - -c "exec env DISPLAY='$DISPLAY' \
                  XAUTHORITY='${XAUTHORITY-$HOME/.Xauthority}' \
                  "'"$SHELL"'" -c '$*'"
</PRE>
</CODE></BLOCKQUOTE>
<P>
<P>$B%9%/%j%W%H$r(B <CODE>/usr/local/bin/xroot</CODE> $B$H$9$l$P(B
<P>
<BLOCKQUOTE><CODE>
<PRE>
xroot 'control-panel &amp;'
</PRE>
</CODE></BLOCKQUOTE>
<P>$B$H$G$-$^$9!#(B
<P>
<P>$B$G$b!"$b$7(B <CODE>xsu</CODE> $B$r$9$G$K@_Dj$7$F$"$l$P!"(B
$B$3$N$h$&$K$7$J$1$l$P$J$i$J$$M}M3$O$"$j$^$;$s!#(B
<P>
<HR>
<A HREF="Remote-X-Apps-8.html">$B<!$N%Z!<%8(B</A>
<A HREF="Remote-X-Apps-6.html">$BA0$N%Z!<%8(B</A>
<A HREF="Remote-X-Apps.html#toc7">$BL\<!$X(B</A>
</BODY>
</HTML>