When executing remote script with SSH:

ssh user@ -t sudo /etc/init.d/wildfly start

WildFly not started. If I run

ssh user@ -t /home/user/my.sh


sudo /etc/init.d/wildfly start
sleep 10

WildFly starting and after 10 sec, when ssh connection closed WF stopped. If I connect "manually" with "ssh user@" and then type in console "sudo /etc/init.d/wildfly start" - no problem.

init.d/wildfly: http://pastebin.com/UDxmEYRZ

How I can start WildFly without manually enter each command in console?

2 Answers 2


nohup could be what you want:

nohup - run a command immune to hangups, with output to a non-tty

sudo nohup /etc/init.d/wildfly start

Put your command in single quotation ' ' : ssh user@ 'sudo /etc/init.d/wildfly start' And also set timeout parameter more in sshd.conf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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