0

I run a small Minecraft server on an Ubuntu PC in my house. Sometimes I have to manage the server outside of my home so I use an ssh client on my phone. This works, but each time I close the app and then relaunch I have to create a new terminal session. How can I toggle to the existing one?

kalenpw
  • 744
  • 5
    see http://askubuntu.com/questions/8653/how-to-keep-processes-running-after-ending-ssh-session – Takkat Nov 24 '15 at 08:27

1 Answers1

1

I suggest you install and keep screen running. It's a terminal multiplexer, in other words - terminal session splitter.

You have to have multiuser mode enabled to that you can attach to that session. So inside the terminal on the server, press Ctrl+a , then immediately Shift+;. The bottom of the screen will highlight and you will see a semicolon there. Type in multiuser on.

Now, from another computer you can SSH into your server, and type in screen -ls to know the title of the session. Example:

xieerqi:$ screen -ls
There is a screen on:
        4704.pts-5.eagle        (11/24/2015 01:23:04 AM)        (Multi, attached)

Type in screen -x sessionTitle to attach. Example:

screen -x 4704.pts-5.eagle       

Now you're back to the existing session.

To detach, use Ctrl+A, followed by d

A.B.
  • 90,397
Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497