SSH bash script to start BeamMP server

Please describe the issue you are having in as much detail as possible:

I am setting up a raspberry pi that will run a website and can make calls to my server via SSH. One of the pi’s bash scripts will need to run the BeamMP-Server.exe file to start the server.

I can successfully SSH into it, and other bash scripts work fine. But when my script starts specifically the BeamMP server exe, I don’t think my SSH connection can see the other files, only the .exe file. I know this issue is because of the SSH connection as when I run it on the PC manually, everything starts fine.

Please provide any evidence or demonstrable content of the issue:

Error it gives me:

No AuthKey specified in the “ServerConfig.toml” file. Please get an AuthKey, enter it into the config file, and restart this server.
Closing in 10 seconds.

Bumping my post

SSH allows you to go anywhere on the system you’re connected to, I don’t see how that can be an issue?
That error is because you do not have a key, see here: Server Installation - BeamMP Docs

The issue is not that I don’t have a key. Running the server by literally running the .exe works. I’m using my raspberry pi to start the server for me, that way I don’t have to go to the PC and click the BeamMP-server.exe file. I can launch the file using SSH, but it gives me that error.

Basically, I can get to where the file is easily and open it using SSH, but I don’t think SSH can read the other files in the directory for whatever reason (hence the no authkey found error as it can’t access the serverconfig file).

Edit: Here is the code for the program it runs.

#!/bin/bash

set password

password=‘pass’

target=‘[email protected]

file location on windows

filelocation=‘C:\Users\the big fella\Desktop\BeamMP\BeamMP-server.exe’

SSH into the PC and run the program

sshpass -p “$password” ssh “$target” “cd /d $(dirname “$filelocation”) && cmd /c "$filelocation"”

Hey there I finally had time to set up everything and I tried on my machine and indeed that script does not work correctly. I made a couple of corrections and it no longer complains about the key, please see below:

#!/bin/bash
# Set password
password='pass'
target=‘[email protected]’
# File location in Windows
filelocation='C:\Users\"the big fella"\Desktop\BeamMP'
# SSH into the PC and run the program
sshpass -p "$password" ssh "$target" "cd /d $filelocation && cmd /c BeamMP-Server.exe"

Hope this helped!

1 Like