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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-01-2008, 11:37 AM
|
#1
|
LQ Newbie
Registered: Sep 2008
Posts: 5
Rep:
|
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
|
|
|
10-01-2008, 11:46 AM
|
#2
|
LQ Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852
|
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
|
|
|
10-01-2008, 11:47 AM
|
#3
|
Member
Registered: Aug 2008
Distribution: opensuse, RHEL
Posts: 374
Rep:
|
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.
|
|
|
10-01-2008, 12:09 PM
|
#4
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083
|
Quote:
Originally Posted by robin singh
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
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.
|
|
|
10-01-2008, 12:46 PM
|
#5
|
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,152
|
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."
|
|
|
10-02-2008, 12:29 AM
|
#6
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083
|
Quote:
Originally Posted by tredegar
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.
|
|
|
10-02-2008, 10:16 AM
|
#7
|
Member
Registered: Aug 2008
Distribution: opensuse, RHEL
Posts: 374
Rep:
|
Quote:
Originally Posted by i92guboj
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)
|
|
|
10-03-2008, 12:32 PM
|
#8
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083
|
Quote:
Originally Posted by CRC123
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 12:33 PM.
|
|
|
All times are GMT -5. The time now is 07:06 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|