Latest Updates:
Normal Topic Remote engine running in a GUI - 2023 version (Read 536 times)
an ordinary chessplayer
God Member
*****
Offline


I used to be not bad.

Posts: 1700
Location: Columbus, OH (USA)
Joined: 01/02/15
Remote engine running in a GUI - 2023 version
09/14/23 at 02:29:41
Post Tools
All the extant instructions for doing this were obsoleted when Microsoft added the OpenSSH client to Windows.
https://learn.microsoft.com/en-us/windows/terminal/tutorials/ssh

Now it's as easy to do on Windows as it was on Linux (MacOS, BSD, etc.).
  • The GUI won't be able to prompt you for a password, so you will need passwordless authentication. When you use ssh-keygen to create a key pair, leave the passphrase blank (twice). As usual, move the private key to the client and append the public key to authorized_keys. And it's probably a good practice to create a separate public-private pair for each client that connects to the server.
  • When you create the engine in the GUI, the executable is actually ssh.exe (ssh on Linux).
  • Then in the command line parameters box you put "-t" for a pseudo-tty, next the ssh connection information, finally a remote command in quotes: "cd to the engine working directory; /path/to/engine". For critter we need to cd to /usr/games because that's where I saved critter's opening book, and critter looks for it in whatever is the starting directory.

Tested on a wifi network with a Linux OpenSSH server and the critter engine, and both Windows and Linux clients, each with OpenSSH client and ChessX GUI.

Example ChessX for Windows:
  • Command: C:\Windows\System32\OpenSSH\ssh.exe
  • Options: -t myserverusername@myserverhostname -i C:\Users\mywindowsusername\.ssh\id_ed25519_3 "cd /usr/games; /usr/games/critter"
  • Directory: leave blank, use the cd trick in options

Example ChessX for Linux:
  • Command: /usr/bin/ssh
  • Options: -t myserverusername@myserverhostname -i /home/mylinuxusername/.ssh/id_ed25519_1 "cd /usr/games; /usr/games/critter"
  • Directory: leave blank, use the cd trick in options


An alternative is to create a plain-txt config file. Note that ssh doesn't run in the same context as the user, so generally we need to provide absolute paths.
Code
Select All
# Windows
# C:\Users\mywindowsusername\.ssh\config
host remotecritter
  requesttty     yes
  user           myserverusername
  hostname       myserverhostname
#  hostname       my.server.ip.address
  port           22
  identityfile   C:\Users\mywindowsusername\.ssh\id_ed25519_3
  batchmode      yes
  remotecommand  "cd /usr/games; /usr/games/critter"
 



Code
Select All
# Linux
# /home/mylinuxusername/.ssh/config
host remotecritter
  requesttty     yes
  user           myserverusername
  hostname       myserverhostname
#  hostname       my.server.ip.address
  port           22
  identityfile   /home/mylinuxusername/.ssh/id_ed25519_1
  batchmode      yes
  remotecommand  "cd /usr/games; /usr/games/critter"
 


Either way, in ChessX the Command is still: ssh.exe/ssh ; but the command line options is simplified to: remotecritter 

So could it really be that simple? Not hardly, because of dynamic ip addressing. Today ssh works, tomorrow it stops working.... 
"ssh: Could not resolve hostname foo: Name or service not known" 

Be prepared to go to your server to read an ip address, go to your client to update the Hosts file and/or ~/.ssh/config, perhaps append ".local" to your hostname, restart DNS, and on and on. Probably the simplest thing is to ssh from the command line first thing each day before trying to start the remote engine, because if ssh doesn't work there is no way to recover from that within the GUI.
  
Back to top
 
IP Logged
 
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo