Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm curious as to how you can go about starting software through an SSH tunnel, but keep the software running on the SSH server.

For example, I host a minecraft server for my brother and his friends. If something happens and I need to restart the minecraft software, while I can do it from any computer via Putty or the Terminal, that session of the minecraft software running will only stay alive if I keep the SSH tunnel up.

How can I start software and services using SSH without having the SSH Client host the software sessions?

share|improve this question

closed as off topic by Sven, Chopper3, Dan, EEAA, Ward May 29 '12 at 3:05

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

This is a question about your hobby and therefore off-topic here. Anyway, read – Sven May 28 '12 at 15:40
Thanks, but that link is actually off topic. I don't care about minecraft, I'm asking a general question about ssh. The minecraft example was just example. – Kyle May 28 '12 at 15:50
up vote 3 down vote accepted

In this example I will use svnserve as the daemon process that has to be started. So, assuming your SSH user-name is "kyle" and your server's host-name is "", you can execute following:

ssh -f "svnserve -d"

Sometimes user must force allocation of the pseudo-terminal, in that case use the -t flag:

ssh -t "svnserve -d"

If your daemon process does not know how to "daemonise" itself, then you can send it to the background:

ssh -f "/usr/local/bin/minecraft-server &"

Reading SSH manual page is highly recommended... ;) You could find this information yourself if you have spent 2min reading SSH client's manual page.

share|improve this answer
Thank you Dejan. I appreciate the answer and will make sure all future questions have more thorough research first. – Kyle May 28 '12 at 16:50

You should use screen or tmux.

screen start screen, then you can attach and detach the terminal at will ( ctrl + A , D ) to detach.

share|improve this answer
No. Running a server software from inside a screen session might be possible but you want to create a proper service out of it so it get actually started automatically if you need to restart the machine. – Sven May 28 '12 at 15:39
Writing a service is most of the time non trivial to do it right ( some servers do not correctly close all open files, do not write pid file, etc ). This also requires root access and not everybody has it. – Misc May 28 '12 at 15:44
Yes, this is a task for a professional sysadmin, not an amateur. Server Fault is for pros only. – Sven May 28 '12 at 15:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.