LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   run a shell script on remote client from a server to find all its running process (http://www.linuxquestions.org/questions/linux-newbie-8/run-a-shell-script-on-remote-client-from-a-server-to-find-all-its-running-process-673550/)

robin singh 10-01-2008 10:37 AM

run a shell script on remote client from a server to find all its running process
 
hi, i want to write a shell script to find all system information of client machine from a server without tyhe knowledge of client machine that a script is running.I have problem that how i trnsfer the file to client machine run it and store the out put in an excel sheet and bring back the excel sheet to server

MS3FGX 10-01-2008 10:46 AM

If all you want to do is find what is running on the remote machine, you don't need anything more complicated than:

Code:

ssh user@server ps -A

CRC123 10-01-2008 10:47 AM

That sounds kind of shady. What are you trying to do this for?

I don't know that there is any way to run a program on a machine without that machine knowing.

i92guboj 10-01-2008 11:09 AM

Quote:

Originally Posted by robin singh (Post 3297124)
hi, i want to write a shell script to find all system information of client machine from a server without tyhe knowledge of client machine that a script is running.

Quote:

Originally Posted by CRC123 (Post 3297138)
That sounds kind of shady. What are you trying to do this for?

I don't know that there is any way to run a program on a machine without that machine knowing.

Of course there is not. A kernel can't create a process without knowing that that process exist. It's an incongruent statement.

Quote:

I have problem that how i trnsfer the file to client machine run it and store the out put in an excel sheet and bring back the excel sheet to server
If you really want to run as stealthy as possible, why are you intending to do lots of transformations on the client machine? It's the wrong way.

Instead, pick the needed data, bring it to your server and transform it there locally.

Code:

ssh user@machine << EOF > outfile.txt
ps -A
cat /proc/cpuinfo
#whatever you want to run to collect data
EOF

Then do whatever you want with that data on your server.

tredegar 10-01-2008 11:46 AM

Someone hasn't read the LQ Rules:

http://www.linuxquestions.org/linux/rules.html

"Posts containing information about cracking, piracy, warez, fraud or any topic that could be damaging to either LinuxQuestions.org or any third party will be immediately removed."

i92guboj 10-01-2008 11:29 PM

Quote:

Originally Posted by tredegar (Post 3297203)
Someone hasn't read the LQ Rules:

http://www.linuxquestions.org/linux/rules.html

"Posts containing information about cracking, piracy, warez, fraud or any topic that could be damaging to either LinuxQuestions.org or any third party will be immediately removed."

Either I am missing your point completely or you are overreacting. We all do administrative tasks everyday that require similar things. This is not illegal activity. In first place you need to login to that machine using ssh with an user name and a key, that alone should be enough to demonstrate you are a legitimate user on that machine (and if you aren't it's your problem, not ours).

This is completely unrelated to an exploit or whatever you imagined and I see nothing that's not legitimate on this thread.

CRC123 10-02-2008 09:16 AM

Quote:

Originally Posted by i92guboj (Post 3297629)
Either I am missing your point completely or you are overreacting. We all do administrative tasks everyday that require similar things. This is not illegal activity. In first place you need to login to that machine using ssh with an user name and a key, that alone should be enough to demonstrate you are a legitimate user on that machine (and if you aren't it's your problem, not ours).

This is completely unrelated to an exploit or whatever you imagined and I see nothing that's not legitimate on this thread.

Did you read the OP's post? Here are some key 'shady' sentences:
Quote:

...find all system information of client machine from a server without tyhe knowledge of client machine that a script is running.
aka, without setting off any alarms and without being logged.

Quote:

...i trnsfer the file to client machine run it...
aka, run a program that he doesn't want anyone to know he ran.

If this doesn't sound shady to you, then you're crazy. (IMO)

i92guboj 10-03-2008 11:32 AM

Quote:

Originally Posted by CRC123 (Post 3298024)
Did you read the OP's post?

Yup.

Quote:

Here are some key 'shady' sentences: aka, without setting off any alarms and without being logged.
THat's your interpretation. Those words are not his. Anyway, as I already explained: you can't do so without being logged and you can't run anything on a given box without the kernel noticing it. So, that should be clear by now. No need to repeat it again.

Quote:

aka, run a program that he doesn't want anyone to know he ran.
Maybe he just want to monitor the usage that their (co) workers are doing of the bussiness resources. This might be a bit big-brotherish, but perfectly legal. As I already said, if he has login access then there's nothing for us to worry about, and if he hasn't there isn't either, since he can't do anything. I don't know what the problem is...

Quote:

if this doesn't sound shady to you, then you're crazy. (IMO)
I might be crazy, but not because of this. :)


All times are GMT -5. The time now is 11:16 PM.