LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-01-2008, 10:37 AM   #1
robin singh
LQ Newbie
 
Registered: Sep 2008
Posts: 5

Rep: Reputation: 0
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
 
Old 10-01-2008, 10:46 AM   #2
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
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
 
Old 10-01-2008, 10:47 AM   #3
CRC123
Member
 
Registered: Aug 2008
Distribution: opensuse, RHEL
Posts: 374
Blog Entries: 1

Rep: Reputation: 31
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.
 
Old 10-01-2008, 11:09 AM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,036

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
Quote:
Originally Posted by robin singh View Post
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 View Post
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.
 
Old 10-01-2008, 11:46 AM   #5
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
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."
 
Old 10-01-2008, 11:29 PM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,036

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
Quote:
Originally Posted by tredegar View Post
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.
 
Old 10-02-2008, 09:16 AM   #7
CRC123
Member
 
Registered: Aug 2008
Distribution: opensuse, RHEL
Posts: 374
Blog Entries: 1

Rep: Reputation: 31
Quote:
Originally Posted by i92guboj View Post
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)
 
Old 10-03-2008, 11:32 AM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,036

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
Quote:
Originally Posted by CRC123 View Post
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.

Last edited by i92guboj; 10-03-2008 at 11:33 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script : Kill a running process when another process starts ashmew2 Linux - General 3 08-20-2008 03:47 AM
How to stop a process running in background (on a shell script) Azk00 Linux - Newbie 3 02-01-2008 04:24 AM
Cannot run shell script on the remote server haresh_dba Linux - General 2 04-14-2007 09:26 AM
How to find out whether a process is dead or alive from within a shell script file walwali Linux - Software 2 12-24-2005 01:39 PM


All times are GMT -5. The time now is 04:55 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration