2

I know you can do Control+C to force quit it, but say I am running a program on the screen such as a Minecraft server... how do I leave the screen while in SSH without shutting off the screen/server?

Is there a shortcut?

I doubt I can type any commands, since the Minecraft program is a console.

Gray Adams
  • 165
  • 6

3 Answers3

7

You could run the process in screen or byobu and detach the screen session - ctrl ad in screen or f6 in byobu

Journeyman Geek
  • 6,969
  • 3
  • 31
  • 49
4

nohup or screen are the way to go if you haven't started the process yet - the earlier captures the output for you in a file, while the latter is more complex and allows you to resume control of the process in a latter connection (learning GNU Screen is really worth it). If you are already running it and you don't want to quit and restart it, though, you can do the following:

  • Suspend the process with ctrl-Z
  • Resume it in the background with bg.
  • Disown it (detach it from the current shell) with disown %1

Now the process isn't related to your TTY anymore and you can safely disconnect from the server.

Eduardo Ivanec
  • 14,531
  • 1
  • 35
  • 42
3

You want to nohup the server and run it in the background. nohup minecraftserver &

Nohup keeps the system from killing the process when you log out of your shell and the & at the end runs it in the background.

resmon6
  • 1,342
  • 6
  • 8