user24979: I want to analyse chess games with xboard and stockfish. Locally this is no problem.
But my PC is slow, so I have rented a faster linux server, and I want let stockfish run on it.
How can I use xboard on my PC, to connect to stockfish running on the linux server?
I have tried on the command line:
1) ssh -p <port> <user>@<host> /usr/games/stockfish

This works. But:
2) xboard -fcp "ssh -p <port> <user>@<host> /usr/games/stockfish" -fUCI

does not work. There is a connection to stockfish on the server, xboard gives the correct version of the engine, but as soon as I enter the first move, it terminates with error of "broken pipe."

user25203: You need to connect to your server with ssh -X command to enable X forwarding. The details of how this needs to be configured can be found in this answer on
Unix and Linux Stack Exchange.

user7985: I have tried to replicate your setup. To this end, I prepared to virtual machines.
First one, let's call it xboard, with xboard and polyglot installed, but -while not strictly required- not stockfish, fairymax or other engines.
Second one, let's call it stockfish, runs a ssh server and does have stockfish installed.
xboard machine is able to connect to stockfish machine via ssh. In this case ssh host suffices but using the full ssh -p <port> <user>@<host> /usr/games/stockfish in the command works as well.
The command you provided
xboard -fcp "ssh -p 22 user@stockfish.host /usr/games/stockfish" -fUCI

works perfectly. xboard is started locally and connects to stockfish via ssh.
I would recommend to set up ssh key authentication. OTherwise, when you start xboard you will need to manually input the password on the terminal where you are running xboard (and if you waited too long, the connection could timeout).
The error you are facing I can reproduce if manually killing polyglot. If ssh failed, polyglot is providing an error.
I don't see why it would be failing (maybe your versions aren't able to properly cope with spaces in the parameters=), but since directly playing with stockfish via ssh works I would try running:
polyglot -noini -ec "ssh -p 22 user@host /usr/games/stockfish" -ed . -uci NalimovCache=4 -pg ShowTbHits=true

which is the command that my xboard runs to connect.

user24979: First, thanks to "Ángel" for going to such great lengths in trying to help me and come up with a solution.
After reading some other posts/howtos on the internet (can't remember where exactly), I got it working this way:
xboard -fcp "./ssh user@host './start_stockfish'" -fd
"/home/user/Remote

putting ssh, polyglot and Stockfish.ini into the "Remote" directory on the remote server. "start_stockfish.sh" (also on the remote server) simply looks like this:
cd ~/Remote
polyglot ./Stockfish.ini


24979: <p>I want to analyse chess games with xboard and stockfish. Locally this is no problem.
But my PC is slow, so I have rented a faster linux server, and I want let stockfish run on it.</p>
<p>How can I use xboard on my PC, to connect to stockfish running on the linux server?</p>
<p>I have tried on the command line:</p>
<pre><code>1) ssh -p &lt;port&gt; &lt;user&gt;@&lt;host&gt; /usr/games/stockfish
</code></pre>
<p>This works. But:</p>
<pre><code>2) xboard -fcp &quot;ssh -p &lt;port&gt; &lt;user&gt;@&lt;host&gt; /usr/games/stockfish&quot; -fUCI
</code></pre>
<p>does not work. There is a connection to stockfish on the server, xboard gives the correct version of the engine, but as soon as I enter the first move, it terminates with error of &quot;broken pipe.&quot;</p>
 25203: <p>You need to connect to your server with <code>ssh -X</code> command to enable X forwarding. The details of how this needs to be configured can be found in <a href="https://unix.stackexchange.com/questions/12755/how-to-forward-x-over-ssh-to-run-graphics-applications-remotely">this answer on
Unix and Linux Stack Exchange</a>.</p>
 7985: <p>I have tried to replicate your setup. To this end, I prepared to virtual machines.</p>
<p>First one, let's call it xboard, with <code>xboard</code> and <code>polyglot</code> installed, but -while not strictly required- not <code>stockfish</code>, <code>fairymax</code> or other engines.</p>
<p>Second one, let's call it stockfish, runs a ssh server and does have stockfish installed.</p>
<p>xboard machine is able to connect to stockfish machine via ssh. In this case <code>ssh host</code> suffices but using the full <code>ssh -p &lt;port&gt; &lt;user&gt;@&lt;host&gt; /usr/games/stockfish</code> in the command works as well.</p>
<p>The command you provided</p>
<pre><code>xboard -fcp &quot;ssh -p 22 user@stockfish.host /usr/games/stockfish&quot; -fUCI
</code></pre>
<p>works perfectly. xboard is started locally and connects to stockfish via ssh.</p>
<p>I would recommend to set up ssh key authentication. OTherwise, when you start xboard you will need to manually input the password on the terminal where you are running xboard (and if you waited too long, the connection could timeout).</p>
<p>The error you are facing I can reproduce if manually killing polyglot. If ssh failed, polyglot is providing an error.</p>
<p>I don't see why it would be failing (maybe your versions aren't able to properly cope with spaces in the parameters=), but since directly playing with stockfish via ssh works I would try running:</p>
<pre><code>polyglot -noini -ec &quot;ssh -p 22 user@host /usr/games/stockfish&quot; -ed . -uci NalimovCache=4 -pg ShowTbHits=true
</code></pre>
<p>which is the command that my xboard runs to connect.</p>
 24979: <p>First, thanks to &quot;Ángel&quot; for going to such great lengths in trying to help me and come up with a solution.</p>
<p>After reading some other posts/howtos on the internet (can't remember where exactly), I got it working this way:</p>
<pre><code>xboard -fcp &quot;./ssh user@host './start_stockfish'&quot; -fd
&quot;/home/user/Remote
</code></pre>
<p>putting ssh, polyglot and Stockfish.ini into the &quot;Remote&quot; directory on the remote server. &quot;start_stockfish.sh&quot; (also on the remote server) simply looks like this:</p>
<pre><code>cd ~/Remote
polyglot ./Stockfish.ini
</code></pre>
