使用终端命令更改安全性和隐私高级设置 [英] terminal command to change Security and Privacy Advanced Setting

查看:60
本文介绍了使用终端命令更改安全性和隐私高级设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://cdn.osxdaily.com/wp-content/uploads/2013/03/automatic-log-out-mac.jpg (我要检查的设置图片)

http://cdn.osxdaily.com/wp-content/uploads/2013/03/automatic-log-out-mac.jpg (picture of the setting I am trying to check)

我试图弄清楚如何使用终端命令来检查该设置和时间限制.我必须使用终端,因为我试图将其放入映像中,以便进行部署.

I am trying to figure out how to use a terminal command to check that setting and time limit. I have to use the terminal because I am trying to get it into my image so I can deploy it.

Mac El Capitan系统偏好设置>安全性和隐私>高级>闲置90分钟后退出.

Mac El Capitan System Preferences > Security & Privacy > Advanced > "Log out after 90 minutes of inactivity.

问题:如何从终端更改该设置.

Question: How do I change that setting from Terminal.

预先感谢

推荐答案

设置位于此文件中:/Library/Preferences/.GlobalPreferences

(奇怪地)由两个键控制:

It is (weirdly) controlled by two keys:

com.apple.autologout.AutoLogOutDelay

com.apple.autologout.AutoLogOutDelay

com.apple.securitypref.logoutvalue

com.apple.securitypref.logoutvalue

您必须同时设置两者,才能使其正确显示在系统偏好设置"中(还必须退出并重新启动才能获取更新的设置).

You have to set both for it to appear correctly in the System Preferences (which you also have to quit and relaunch to get it to pick up updated settings).

要查看当前设置(如果有的话):

To view the current setting (if there is one):

defaults read /Library/Preferences/.GlobalPreferences com.apple.autologout.AutoLogOutDelay
defaults read /Library/Preferences/.GlobalPreferences com.apple.securitypref.logoutvalue

要将值更改为一小时(3600秒):

To change the value to one hour (3600 seconds):

sudo defaults write /Library/Preferences/.GlobalPreferences com.apple.autologout.AutoLogOutDelay -int 3600
sudo defaults write /Library/Preferences/.GlobalPreferences com.apple.securitypref.logoutvalue -int 3600

这篇关于使用终端命令更改安全性和隐私高级设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆