Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
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.
|
 |
09-11-2005, 06:19 AM
|
#1
|
Member
Registered: Jun 2005
Location: Netherlands
Distribution: Gentoo
Posts: 32
Rep:
|
Shell Script to shutdown network computers?
Hey guys, I am attempting to make a shell script called shutemdown that would shutdown all the computers on my network...but I have no clue how to do that yet haha. Any suggestions? The only idea that I have come up with so far is to ssh into each computer and have shutdown -h now run. There was be a simple way.... Is there also any way to shutdown all computers including windows ones or would I only be able to shutdown linux computers? Thanks in advance!
|
|
|
09-11-2005, 06:23 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
you could use rexec to do this, but personally i'd suggest using ssh as you have already speculated. it will (presumably) already be running unlike rexecd and nice and secure. just run "ssh hostname poweroff" for each hostname (on a loop) using rsa or dsa shared key authentication, job's a good 'un.
|
|
|
09-11-2005, 06:35 AM
|
#3
|
Member
Registered: Jun 2005
Location: Netherlands
Distribution: Gentoo
Posts: 32
Original Poster
Rep:
|
I'm still really new to this so sorry for the really basic questions here:
What is rexec?
All that I would have to do is 'ssh computer poweroff'? I would still need to replace computer with the computer's hostname....
Thank you for your help!
|
|
|
09-11-2005, 07:48 AM
|
#4
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
rexec (as any online documentation would tell you) is a remote execution program. to run programs on a remote machine. there's not necessarily a need for a specific server to run just for that, as ssh can do it too.
and yes, unless your server is psychic, you'd need to replace the hostname each time ;-)
|
|
|
09-11-2005, 09:41 AM
|
#5
|
Member
Registered: Jun 2005
Location: Netherlands
Distribution: Gentoo
Posts: 32
Original Poster
Rep:
|
Haha thanks so much! I got the script working mainly, but it makes me type the password for each logon....how can I put the password into the ssh root@x.x.x.x poweroff command?
|
|
|
09-11-2005, 10:28 AM
|
#6
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
i already said... use shared keys.
|
|
|
09-11-2005, 10:28 AM
|
#7
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
|
|
|
All times are GMT -5. The time now is 11:59 AM.
|
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
|
|