Jump to content
IGNORED

Start/stop TNFS server on Windows 10 via SSH


Recommended Posts

I recently set up a TNFS server to use with FujiNet on my Atari 8-bits. Most people run the server on a Raspberry Pi, but with the current energy crisis(!) I wanted to do it from my always-on Windows 10 machine. After using files on FujiNet, even if I eject them from slots, I frequently can’t modify or delete them as they’re reported as in-use by the client I’m using, even when the FujiNet device is turned off. I haven’t tried this yet to see if it fixes the problem, but in any case, I wanted to find an easy way of restarting the server without needing to physically be on the Windows machine.

I chose to do this via SSH using Powershell. Here are the instructions for doing so in case it helps you out. Obviously this can be used to stop/start any service you like, and from any OS that gives you the ability to SSH into another machine.

There may be more elegant solutions, this is just the one I went for!

Install SSH server on Windows 10 via Powershell:

Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

Start and configure server:

Start the sshd service

Start-Service sshd

OPTIONAL but recommended:

Set-Service -Name sshd -StartupType 'Automatic'

Confirm the Firewall rule is configured. It should be created automatically by setup. Run the following to verify:

if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) {
Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it…"
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
} else {
Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists."
}

Set Powershell to be default shell over OpenSSH:

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force

To stop the TNFS server:

taskkill /F /IM tnfsd.exe

To start the TNFS server:

start-process C:\tnfsd\tnfsd.exe C:\tnfsroot
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...