I need a tool/application/doo-hickey that will allow me to remotely shut down a Mac (probably 10.4 by the time I need to do this, but possibly 10.3.x), more precisely a bunch of Macs, over a network. It needs to have the following capabilities or options:
1. Allow me to specify how long after the program is run the computer will shut down. I prefer being able to specify a clock time, but # of seconds is ok too. It must be manually invoked -- not something that is only capable of being pre-scheduled.
2. Be able to be run from the equivalent of a batch file (whatever that means in the Mac world -- I don't know anything about operating from the OS X command line, only a Windows one, but I can learn). Having to click something per station is not satisfactory, as I could potentially need to shut down up to 90 computers with this thing.
3. Pop up a box for the user so they can see the countdown, and allow me to configure a message in that box.
4. Not be closeable or cancelable by the average user (I don't expect protection against specialized knowledge of killing processes or whatnot).
5. Be configurable to not offer the option to save changes on any open files, i.e., to simply pull the rug out from under the user if that's what I desire.
6. A configurable timeout would be a huge bonus. The network is extremely squirrely (fur in the cables and everything; you have no idea) and I don't want to have a station be skipped just because the program didn't wait long enough, or conversely, to spend too much time trying to connect to one in the middle of a row that is already off (which Shouldn't Happen, but sometimes does anyway).
The current setup (for PCs exclusively) is that I run psshutdown.exe by executing one batch file per row of 10, which has proven to be the most practical way to do it. Right now we only have 6 Macs, which are rarely used, so I've been ignoring the very-occasional case of someone still using one at closing time. Sometime within the next year, however, we are going to have a room full of dual-booting iMacs. While the practical likelihood is that they will mostly be booted to Windows (thus, psshutdown will still work, I hope), I won't have any control over which are in what OS state when, so I'll have to alter said batch files on the fly every night so that the correct program is attempting to run on a given station (unless someone knows of a program, preferably for Windows although it would be doable to have me log into one of said Macs to run it, that will remotely shut down either/or!).
I imagine something like this exists, I just don't know where to go looking for it. Halp plz!
1. Allow me to specify how long after the program is run the computer will shut down. I prefer being able to specify a clock time, but # of seconds is ok too. It must be manually invoked -- not something that is only capable of being pre-scheduled.
2. Be able to be run from the equivalent of a batch file (whatever that means in the Mac world -- I don't know anything about operating from the OS X command line, only a Windows one, but I can learn). Having to click something per station is not satisfactory, as I could potentially need to shut down up to 90 computers with this thing.
3. Pop up a box for the user so they can see the countdown, and allow me to configure a message in that box.
4. Not be closeable or cancelable by the average user (I don't expect protection against specialized knowledge of killing processes or whatnot).
5. Be configurable to not offer the option to save changes on any open files, i.e., to simply pull the rug out from under the user if that's what I desire.
6. A configurable timeout would be a huge bonus. The network is extremely squirrely (fur in the cables and everything; you have no idea) and I don't want to have a station be skipped just because the program didn't wait long enough, or conversely, to spend too much time trying to connect to one in the middle of a row that is already off (which Shouldn't Happen, but sometimes does anyway).
The current setup (for PCs exclusively) is that I run psshutdown.exe by executing one batch file per row of 10, which has proven to be the most practical way to do it. Right now we only have 6 Macs, which are rarely used, so I've been ignoring the very-occasional case of someone still using one at closing time. Sometime within the next year, however, we are going to have a room full of dual-booting iMacs. While the practical likelihood is that they will mostly be booted to Windows (thus, psshutdown will still work, I hope), I won't have any control over which are in what OS state when, so I'll have to alter said batch files on the fly every night so that the correct program is attempting to run on a given station (unless someone knows of a program, preferably for Windows although it would be doable to have me log into one of said Macs to run it, that will remotely shut down either/or!).
I imagine something like this exists, I just don't know where to go looking for it. Halp plz!
no subject
Date: Jun. 27th, 2007 12:12 am (UTC)From:no subject
Date: Jun. 27th, 2007 12:29 am (UTC)From:no subject
Date: Jun. 27th, 2007 12:32 am (UTC)From:no subject
Date: Jun. 27th, 2007 01:24 am (UTC)From:SHUTDOWN(8) BSD System Manager's Manual SHUTDOWN(8)
NAME
shutdown -- close down the system at a given time
SYNOPSIS
shutdown [-] [-h [-u] | -r | -k] [-o [-n]] time [warning-message ...]
DESCRIPTION
The shutdown utility provides an automated shutdown procedure for super-
users to nicely notify users when the system is shutting down, saving
them from system administrators, hackers, and gurus, who would otherwise
not bother with such niceties.
The following options are available:
-h The system is halted at the specified time.
-r The system is rebooted at the specified time.
-k Kick everybody off. The -k option does not actually halt the
system, but leaves the system multi-user with logins disabled
(for all but super-user).
:
....basically this will do everything you need to do, we'd just need to put it into a hand bash script (or maybe an Apple Script, but honestly I've never worked with Apple Scripts before). I found this link that may help:
http://www.oreillynet.com/pub/a/mac/2003/11/07/scripting_osx.html
Bash is basically like batch files in Windows except they work better.:)
I'll see if I can come up with something and test it for you, but I'd have to test it from one of my Linux machines so it wouldn't actually be a true test.
no subject
Date: Jun. 27th, 2007 02:03 am (UTC)From:no subject
Date: Jun. 27th, 2007 02:31 am (UTC)From:sudo shutdown -h +5 "system going belly-up in five minutes"
It'd have to be tested, of course, but it should work.
So, basically, what you'd need to do is ssh to the Mac using putty and execute that command. You may even be able to ssh with Cygwin, but I'm not sure. Putty would probably be the easiest.
On the mac side, go to Preferences-->Sharing-->Remote Login and start this service. If you don't do this, you won't be able to ssh to your mac.
Here's a thread on a forum for someone in almost your exact situation:
http://softwares.bajram.com/utilities/#Super_Shut_Down
...and this suggestion may work:
http://softwares.bajram.com/utilities/#Super_Shut_Down
I think your best bet is a quick script using ssh though.
no subject
Date: Jun. 27th, 2007 03:04 am (UTC)From:To the individual stations, you mean? (I definitely can't ssh to the server.) One at a time? Or by "script" are you saying I can construct something which will automate the process and do the work of logging in to each individual machine, issuing this command, and then moving on to the next one.
On the mac side, go to Preferences-->Sharing-->Remote Login and start this service. If you don't do this, you won't be able to ssh to your mac.
This doesn't sound good. I definitely don't want J Random User to be able to ssh into the station, and the student login doesn't have a password (yes yes, I know, but I am not the sysadmin, and even if they did have a password, all the students would, obviously, have to know it).
no subject
Date: Jun. 27th, 2007 04:02 am (UTC)From:http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/Articles/Daemons.html
...and ACK! No password for the student login? There's a scary thought for you. Of course depending on how tight your IT department locks down that user they may not be able to do much, anyway, unless they can find the root password, which, hey, it's a college so I'm sure there are a few people there who could find it. One nice thing about Macs is you can actually lock down user access a bit more than you can on a Windows machine -- or should I say a bit more effectively.
As for ssh you might be able to restrict ssh capability to specific users. That's something you'd have to ask someone with a bit more security knowledge than I have. If this was the case, that would be one option, but yeah, you'd have to go into each one on some level or another or you could write a script that calls a list of servers, ssh's to them, prompts for the password and then executes a specific command. We had something like that at SunRocket on our Linux machines, but the logic should work on a Mac. But, again, this would involve using ssh.
no subject
Date: Jun. 27th, 2007 05:56 am (UTC)From:When ssh is setup, you want to restrict login to only the user that shuts it down - which probably would be root or admin or something.
no subject
Date: Jun. 27th, 2007 06:41 am (UTC)From:no subject
Date: Jun. 27th, 2007 06:43 am (UTC)From:Yes, except it's different on Fridays, and as I said, it really needs to be something manually executed because it's not always the same things that need shutting down. (As it sits now it's just a row-by-row difference; in the new situation, it will be a station-by-station difference.)
All of what you are suggesting/describing sounds like requiring way more access and/or control (...over the IT dept) than I actually have, or can hope to have. Oh well. TY anyway.
no subject
Date: Jun. 27th, 2007 03:10 am (UTC)From:That application is kind of cool, but I don't see remote execution functionality (it looks like it would need to be run separately on each machine), and it appears that full control remains in the hands of the user (what is meant by "you can force the shutdown" is not clear). I'll have to try it on one of the Macs tomorrow though.
no subject
Date: Jun. 27th, 2007 04:03 am (UTC)From:no subject
Date: Jun. 27th, 2007 06:59 pm (UTC)From:one of my oldest friends
he charges around $130 an hour as a consultant;
you get help free!
Can I get the perosn's info direct? i can help.
there are a couple of options
Apple Remote Desktop will do it
a task server will do it
Givee them my contact info, I don't mind talking to them
--
Steve Favarger
Favarger Consulting
Making Technology the Solution
c) 310.466.4876
steve@favarger.net
http://www.favarger.net
no subject
Date: Jun. 28th, 2007 11:07 pm (UTC)From: