Managing a server over SSH
Solution 1
Use screen
. You'll find it in the package manager.
So start a screen session, then start the minecraft server.
Next time you ssh to the box, you can screen -r
and it will bring the session back.
Solution 2
If the server is a command line program, consider running it in a screen session.
e.g.:
$ screen $ minecraft-server-program
Then press Ctrl-A-D to detach from the session. From an ssh session, type in screen -r
to resume the screen session.
Related videos on Youtube
Grady S
Updated on September 18, 2022Comments
-
Grady S over 1 year
I am running a Minecraft server on Fedora 15. I have openssh-server installed on the server and I can connect to it just fine.
Right now, the Minecraft server software opens into a terminal when the user logs in. The server software has a console that accepts commands and prints status updates and stuff like that. I am wondering if there is a way that I can access that already-running server console remotely over SSH.
-
Paul over 12 yearsHeh. Looks like everyone loves screen. I think Dolda2000 was first.
-
-
Grady S over 12 yearsIs there any way that I can detach a screen session running locally on the machine while I am using ssh?
-
Paul over 12 yearsIf you have a prompt, you can type
screen -d
. If you are running something, you can type ctrl-a-d. Also, just ending your ssh session will leave the screen session running in a detached state. If you use linux command line more than a little, you really want to get into usingscreen
. It will make you happy. Look online for .screenrc examples.screen
can run multple concurrent bash shells that you can switch between, which saves running multiple ssh sessions - and they all survive a logout-login. -
Paul over 12 yearsWhile this isn't really a place for chatting - do you know the pros and cons versus
screen
?Ctrl-b
is one already, but I could always remapctrl-a
inscreen
if it bothered me enough. -
Jin over 12 years@Paul Why does it bother you? I've actually remapped
tmux
's prefix key fromb
toa
. Anyway, you can check out this Unix.SE question for the comparison. unix.stackexchange.com/questions/549/tmux-vs-gnu-screen -
Paul over 12 yearsSome of the console apps I use from time to time need ctrl-a - but not frequently enough to make it worthwhile, I just work around it normally.