V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
1423
V2EX  ›  问与答

OS X 下,如何指定让某个程序执行特权操作时,无需再输入密码?

  •  
  •   1423 · 2015-04-15 12:31:40 +08:00 · 2461 次点击
    这是一个创建于 3299 天前的主题,其中的信息可能已经有所发展或是发生改变。

    其实是电信的客户端,每次都输2遍密码才能连上网,挺麻烦的

    6 条回复    2015-04-15 15:50:00 +08:00
    tmqhliu
        1
    tmqhliu  
       2015-04-15 15:18:28 +08:00
    owner改成root,再用chmod u+s 设置sticky bit
    tmqhliu
        2
    tmqhliu  
       2015-04-15 15:20:00 +08:00
    说错了是用chmod u+s设置 setuid
    yxjxx
        3
    yxjxx  
       2015-04-15 15:43:01 +08:00   ❤️ 1
    我的启动锐捷的方式,其实做成了Alfred workflow,供参考。
    https://gist.github.com/bc206d68a0396585a666.git
    1423
        4
    1423  
    OP
       2015-04-15 15:43:39 +08:00
    @tmqhliu 设置了,然后无法运行。
    ➜ ~ /Applications/E信.app/Contents/MacOS/E信
    dyld: Library not loaded: @executable_path/../Frameworks/xlpppoectl.framework/Versions/A/xlpppoectl
    Referenced from: /Applications/E信.app/Contents/MacOS/E信
    Reason: unsafe use of @executable_path in /Applications/E信.app/Contents/MacOS/E信 with restricted binary
    [1] 4724 trace trap /Applications/E信.app/Contents/MacOS/E信

    我觉得苹果系统本身可能有什么办法能允许程序修改系统设置且不需输入密码,没想过设置 setuid 的方法。
    yxjxx
        5
    yxjxx  
       2015-04-15 15:44:04 +08:00   ❤️ 1
    1423
        6
    1423  
    OP
       2015-04-15 15:50:00 +08:00
    @yxjxx It works,谢谢。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2962 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:48 · PVG 21:48 · LAX 06:48 · JFK 09:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.