Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Secure-Shell
[Top] [All Lists]

Re: Using ssh remote for a nohup process

Subject: Re: Using ssh remote for a nohup process
Date: Mon, 3 Oct 2005 14:42:45 -0400
On Sun, Oct 02, 2005 at 09:58:58AM -0100, Jim Horwath wrote:
#!/usr/bin/ksh
cd /dir/bin
nohup ./foobar arg1 arg2 arg3 &
echo $! > /dir/dir1/proc.pid
exit 0

On machine a I am doing

ssh machineb "sudo -u daemon_user /dir/bin/foobar.sh "

The sudo command works without a password

That seems rather ill-advised, but I'll trust that you know what
you're doing.

I test it locally on machine b.  If I run the remote ssh command all
output from the script on machine b is printed to my screen. It
appears the ssh/sudo combination is ignoring the nohup and &.  

That may not be the case, and seems rather unlikely.  So, what you're
complaining about is the output to your terminal, correct?

One possibility is that foobar may be writing directly to your
terminal, rather than STDOUT.  If so, nohup won't help you here.  It
may still be possible to redirect that output somewhere, but I don't
have time to explain how, so first figure out if that is what is going
on.  If so, I'll explain later, after you reply.

If foobar is a shell script, look for it to be sending output to
/dev/tty, or some other redirection.  If it isn't, then either you'll
need to supply more info, or you're on your own.

-- 
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D

Attachment: pgpk9pg95ozES.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>