Change Security & Privacy setting from terminal
Using AppleScript :

tell application "System Events"
    tell security preferences
    set properties to {require password to unlock:true}
    end tell
end tell


You can call the Applescript code using the osascript command.