Unix command to require password to wake computer from sleep or screensaver

Yo folks,
Just as the subject says, is there a Unix command we can send that turns on the option to require password when the computer wakes from sleep or screensaver...which is the first option in System Preferences --> Security?
I looked through the systemsetup commands and didn't find anything.
Thanks!

Run the following AppleScript:
set items_1 to items -18 thru -2 of (do shell script "ifconfig en0 ether")
set items_2 to ""
repeat with this_item in items_1
if this_item is greater than ":" then
set items_2 to items_2 & this_item
end if
end repeat
set the_path to "defaults read ByHost/com.apple.screensaver." & items_2
set old_string to do shell script the_path
set new_string to (items 1 thru 6 of old_string) & "askForPassword = 1;" & (items 27 thru -1 of old_string) as string
do shell script "defaults write ByHost/com.apple.screensaver." & items_2 & " '" & new_string & "'"
The necessary plist key is part of an array, and is in a file which has the computer's Ethernet address in its file name, so the script needs to handle both tasks. This change will not show up in the GUI until the account logs out and back in.
(24015)

Similar Messages

  • Change "require password to wake this computer from sleep or screensaver"

    Does anyone know how to change the checkbox in sys prefs > security > require password to wake this computer from sleep or screensaver via cli?
    I would like to always have this enabled, but individual users can shut this off...
    Thanks

    Code an AppleScript using the SystemsEvents>SecuritySuite>SecurityPreferencesObject>RequirePasswordtoWake then use the cli 'open' to run it?

  • Require password to wake computer...

    I have set this option in the Security section of the computer prefs. It seems that at random times it refuses to take the password in order for it to wake from sleep or screensaver. Only way around is to force reboot, safe mode boot, and then reboot back into the user. If I boot directly into the user, I get the blank finder where only the Spotlight Icon appears. I have tried to change my users password and it still happens. Repaired permissions as well as checked on the HD.
    Is there any sort of fix for this? It is rather annoying. I have advised everyone to save before getting up so they do not loose work, but there has to be something odd going on.
    Thanks

    Sorry, I'm out of ideas. Hopefully, others will chime in here. In the meantime................
    If you have AppleCare, get your $$$ worth & contact them for assistance. Or you can also check around on the Knowledge Base website for any password troubleshooting Articles: http://search.info.apple.com/

  • Wake computer from sleep & sync iDisk?

    I'm wanting to wake my computer from sleep & sync my iDisk at a set time in the day. Does anyone know if it would be possible, & if so how?
    I thought if it could be done with AppleScript (wake & sync the iDisk) I could set iCal to run the script at a set time while sleeping which would wake the computer & run the script.

    Your script will not run while the machine is idle, so you have to have some other process effect the wake up. This can be scheduled through System Preferences -> Energy Saver, or through the command line pmset, but you can't just have your AppleScript running in the background and expect the machine to wake on its own.
    So you need to get a script to run your backup, and some other process (e.g. iCal) to start that script at the appropriate time.

  • T400 - Fn Key wakes computer from sleep.

    So, is it normal that by pressing Fn Key + any other key (on the keyboard) - computer wakes up from sleep??
    Or is something wrong with the OS?
    Solved!
    Go to Solution.

    Actually, the Fn key alone should wake the machine from Sleep/Standby.
    Nothing wrong with the OS.
    Regards.
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество
    Community Resources: Participation Rules • Images in posts • Search (Advanced) • Private Messaging
    PM requests for individual support are not answered. If a post solves your issue, please mark it so.
    X1C3 Helix X220 X301 X200T T61p T60p Y3P • T520 T420 T510 T400 R400 T61 Y2P Y13
    I am not a Lenovo employee.

  • Require password ONLY when waking from sleep

    Hello,
    There is a setting that enables a password both when waking from sleep AND when "waking" from screen saver.
    Is there a way to require a password ONLY when waking from sleep, but NOT when "waking" from screen saver?
    Thanks!

    It would appear that the two are inextricably linked. On the other hand, do you really need the screen saver? With an LCD screen it isn't really doing anything useful - you can't burn in static images nearly as easily as you can with a CRT display - and if you are using a laptop you would do much better to use the Energy Saver prefs pane to sleep the display after a period - this will extend the life of the backlight - and AFAIK no password is involved.

  • Mouse wakes computer from sleep

    Any time I close the lid on my MacBook Pro, and accidentally hit my mouse, it wakes the computer from sleep. How can I stop this? There is no "mouse" wake option in Energy Saver, so where can I turn it off?

    Check under *Keyboard & Mouse* in preferences. Mine is a wireless bluetooth mighty mouse and it's under Bluetooth I don't have a USB mouse but from this article there may not be a switch for turning the wake up off.
    How to use your PowerBook G4, MacBook Pro or MacBook with the display closed

  • "Require password to wake computer" background color

    Is there any way to change to color of the background when you awake from sleep and are presented with a login screen? I'm kinda tired of black, an image would be great. Anyone know of a way to do this?

    Dick M wrote:
    Still don't know what you're getting at? When I wake my machine from sleep it goes to the desktop I've set. Go to System Preferences (Apple Logo upper left hand corner) and Desktop Screensaver then Desktop. Is it set to black in solid colors?
    He has it set to ask for a password-a dialog box comes up prompting for a password, with a black background. When you enter it and press enter, your normal desktop appears.
    There's no way to change that color, AFAIK.

  • Wake computer from sleep automatically to run applescript

    Hey guys, here's a problem for you to figure out. I just recently learned some very basic terms for applescript so I figured I'd make an alarm clock to wake me up. I'm looking for some kind of code or program that can wake up the computer just like the Schedule in Energy Saver does, but in a more flexible way.
    This is the code I use for the alarm clock;
    set volume 0
    tell application "Finder"
    activate
    open internet location file "lightningstream.surfernetwork.com/.webloc" of folder "Site Shortcuts" of folder "Desktop" of folder "Nick" of folder "Users" of startup disk
    end tell
    delay 15
    set volume 1
    delay 0.25
    set volume 1.5
    delay 0.25
    set volume 2
    delay 0.25
    set volume 2.5
    delay 0.25
    set volume 3
    delay 0.25
    set volume 3.5
    delay 0.25
    set volume 4
    delay 0.25
    delay 4
    set volume 2
    So this sets the volume to 0, opens up a radio stream, then increases the volume and lowers it. On weekdays this works without a problem because i set the Schedule in Energy Saver to wake the computer on Weekdays at 5:51 AM and then have iCal run the applescript at 5:55 AM. But if i wanted to wake up later in the day on the weekend then I would have to wake the computer to get the script to run.
    I'm looking for some kind of code or program that can wake up the computer just like the Schedule in Energy Saver does, but in a more flexible way.
    Now I realize that there is a sleep and a doze. Usually my computer is in doze because I have a security camera program that runs on it's own schedule. Eventually that shuts off and my Mac sleeps. So i need some way to tell the computer to wake at a specific time from sleep with me having to manually wake it. Any ideas?

    If you're comfortable with the command-line environment (i.e. Terminal.app) you can use the "pmset" command to schedule individual, non-repeating sleep or wake events.
    For example:
    sudo pmset schedule wake "07/04/11 20:00:00"
    Will wake a sleeping mac at 10AM on July 4th 2011. (And only at that date and time, not any other time.)
    For more info on "pmset", execute "man pmset" at the command line.
    Why Apple doesn't build a more flexible scheduling function into the Energy Saver sleep-scheduler (or better yet, right into iCal) I don't know, but the low-level functionality is already easily accessible, right there in the pmset command.
    Depending on your needs, you could write an Applescript or even a fully-fledged application program as a graphical front end to the "pmset" command-line utility. For example, you might use iCal's ability to hand off event data to Applescript as follows:
    - Create a schedule of sleep & wake events in an iCal Calendar.
    - Use Applescript to grab all of those events and parse their date/time/wake/sleep info into a table.
    - Spit that data into a shell script that runs a separate "pmset" command for each event.
    To get really fancy, your application could also read, or perhaps even learn to directly write to, the
    /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist file, which stores a human-readable list of scheduled sleep / wake events.

  • Removing USB wakes computer from sleep.

    I just bought a new monitor to use with my PowerBook. The monitor is a Dell with built in USB plugs. The problem is that when i put the computer to sleep, the monitor(like almost all monitors) goes in to a "power-save" mode (where it doesnt display anything on the screen and the power LED turns orange, wakes when mouse is shaken) And when it does this, it stops giving power to the USB plugs built into it and instatly wakes the computer as if i had pulled out a plug. Is there a way to keep the PowerBook from waking if a USB plug is removed/looses power? Any help would be greatly appreciated.

    Check under *Keyboard & Mouse* in preferences. Mine is a wireless bluetooth mighty mouse and it's under Bluetooth I don't have a USB mouse but from this article there may not be a switch for turning the wake up off.
    How to use your PowerBook G4, MacBook Pro or MacBook with the display closed

  • Bluetooth "wake computer from sleep" function always on?

    Does anyone know if the "allow bluetooth device to wake this computer" option is designed to be always on even when bluetooth is OFF? I have noticed my computer wake unexpectedly due to a bluetooth signal in the area even though bluetooth was off. The option was selected in the preferences but I assumed when bluetooth is off none of the function are on. Thanks to anyone who could clarify this.
    OSX 10.4.11 MacBook Pro 2.16 C2D

    I think it applies to both, and I surmise it's because some people have Bluetooth KBs & Mice that need to wake the computer up.

  • Can Apple TV wake computer from sleep?

    I don't think this is possible unfortunately, but maybe someone else knows better. It seems like a no-brainer to me, so Im not sure why Apple hasn't implemented this feature. It's a TOTAL waste of energy to have my Mac Pro awake all the time just so I can have immediate access to all my Apple TV content (which is obviously streamed from the Mac Pro).
    Yes, I know I can walk to the computer each time I want to use Apple TV and wake it up manually, but it is at the other side of the house and to do this each time me or a member of my family wants to watch something on Apple TV, well it almost ruins the whole convenience of the product.

    Your tv won't wake your mac I'm afraid.
    It may seem like a waste of energy to you not allowing your mac to sleep, however constantly waking up your mac (as is very likely when used in conjunction with a tv) is likely to cause unnecessary wear to your hard drives within it and may be more costly to you in the long run than leaving it awake.

  • Turning off Mighty Mouse wakes computer from sleep

    Two part issue:
    After sleeping the computer I find that the "power down" on the Mighty Mouse causes the computer to awake!! Does anyone have a solution to this Mouse-killing problem?
    I find no instruction about shutting the Mighty Mouse (MM) off when it is not in use (say for overnight). I do see references to relatively short battery life so I imagine that we should power-down the MM when possible. But, the MM appears to be engineered pretty cheaply and it appears that it may not survive many cycles of power up-down. Anyone with thoughts on this?

    Bluetooth or USB devices won't wake up a portable running off of battery power. That probably doesn't help you, but I thought I'd note that. I don't think moving the switch actually triggers the wakeup. Of course you can't do that without holding it by the shell, which almost always senses a button press because of the design of the entire shell as right or left buttons.
    If you leave your mouse powered-on for a while, it should eventually go into standby mode with reduced power consumption. I use rechargeable batteries, so I don't worry too much about battery life. The batteries lasts several weeks before I need to recharge them and I can keep a charged set handy.
    So I take it you're using the mouse to select going to sleep in the pull-down menu and then try turning off the mouse. At least with a portable I can turn the mouse off first then either use the trackpad to put it to sleep or just close the lid.

  • Password required to wake display from sleep. Not working.

    Up until recently, I had my powerbook set up to require a password to wake it from sleep (just the display, not the hard disks) ... All of a sudden, all I have to do is touch a key and it wakes up not requiring a password. I went into the "Energy Save" section and saw that my settings had been reset. Everytime I change it to require a password after 10 minutes of activity, and click on the "lock" to make change, it will reset itself to not require a password.
    I've had my powerbook for over a year and it has never done this until now. I'm not sure why it would reset itself everytime I am out of the "Energy Save" section. Please help as I have sensitive information on my computer that requires a password.

    I'm seeing this on my new Core Duo2 Mac Book Pro. Same kind of behavior. I'm trying to figure out if this is an OSX issue or a hardware sleep issue.

  • MacBook screen goes gray and won't wake up from sleep - 10.6.2

    We have a MacBook Alum running 10.6.2 with 4gb ram.
    We recently upgraded to 10.6.2 from Leopard and this issue started to happen.
    It seems that as the MacBook goes to sleep or goes to the screensaver mode, the screen goes gray and won't wake up from sleep or screensaver mode without a hard reboot.
    Is Apple aware of this issue? It did not happen with the previous version of Leopard. This issue arrived when we upgraded to Snow Leopard. Other than the sleep issue, SL is rock solid. Kudos to Apple for producing a great OS!

    Hi GrooveDaddy,
    Have you contacted AppleCare via telephone to make them aware of this issue? It definitely doesn't sound like normal behavior. What sort of troubleshooting have you done so far on the issue? What sort of settings do you have on your screen saver? Password protected? Custom iPhoto slideshow?
    What if you manually sleep the machine by closing the lid or engaging it via software (via the Apple menu) does the screen have the issue in both scenarios?

Maybe you are looking for

  • Are there any issues after installing AT&T's free McAfee?

    Since installing it on my Mac Pro laptop with Maverick installed, I've been getting unrecognizable app names icons.

  • Distiller uses Finder creator/type "ORAC"/" FDP"

    Distiller 8/9 running on Intel based mac running OSX 10.4.11/10.5.5. It seems that Distiller creates pdf-files with creator/type "ORAC"/" FDP". That causes some systems not to recognice them as pdfs. I hope Adobe will fix Distiller soon so that it wo

  • PLM installation

    Hi, I am new to PLM and was asked today to spec out what it would take to install a PLM instance. I have spent a bunch of time in OSS looking for the components and am not finding much outside of the PLM/PPM component. From what I can tell, this is a

  • Obtaining grid lines for every tick mark in a chart

    I would like to create a chart that contains gridlines for each tick mark. Furthermore, I'd like to keep the notion of major tick marks being longer and being the only labeled tick marks. It seems that the XYChart is only placing gridlines for major

  • After software update, key apps crash

    After installing the following updates, several apps fail to launch. Safari, Software Update Tool, and various install packages. I am working off of Firefox currently. Any ideas? I have done the following...repair permissions, created a new user, ran