slowman
V2EX  ›  问与答

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

  •  
  •   slowman · Apr 15, 2015 · 2961 views
    This topic created in 4082 days ago, the information mentioned may be changed or developed.

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

    6 replies    2015-04-15 15:50:00 +08:00
    tmqhliu
        1
    tmqhliu  
       Apr 15, 2015
    owner改成root,再用chmod u+s 设置sticky bit
    tmqhliu
        2
    tmqhliu  
       Apr 15, 2015
    说错了是用chmod u+s设置 setuid
    yxjxx
        3
    yxjxx  
       Apr 15, 2015   ❤️ 1
    我的启动锐捷的方式,其实做成了Alfred workflow,供参考。
    https://gist.github.com/bc206d68a0396585a666.git
    slowman
        4
    slowman  
    OP
       Apr 15, 2015
    @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  
       Apr 15, 2015   ❤️ 1
    slowman
        6
    slowman  
    OP
       Apr 15, 2015
    @yxjxx It works,谢谢。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2689 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 65ms · UTC 03:50 · PVG 11:50 · LAX 20:50 · JFK 23:50
    ♥ Do have faith in what you're doing.