run a shell script on remote client from a server to find all its running process
Linux - NewbieThis 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.
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.
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
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.
"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."
"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.
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)
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)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.