小编fre*_*nte的帖子

是否可以在 OS X Mountain Lion 下以不同用户身份运行软件?

我一直在尝试以不同的用户身份运行应用程序。

尝试 1
sudo -u otheruser open /Applications/TextEdit.app启动应用程序,但它使用当前用户,而不是otheruser

尝试2
login usernamesu - otheruser成功登录为otheruser,不同的用户活动监控器弹出,但类似open /Applications/TextEdit.app回报的错误LSOpenURLsWithRole() failed with error -10810 for the file /Applications/TextEdit.app.

尝试 3
sudo su - otheruser -c /Applications/TextEdit.app/Contents/MacOS/TextEdit似乎启动了该应用程序(它出现在由otheruser启动的 Activity Monitor 下)但是当停靠图标无限期地弹跳时会出现此错误:_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.

问题
那么……我如何以不同的用户身份运行应用程序?

terminal sudo bash osx-mountain-lion macos

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

bash ×1

macos ×1

osx-mountain-lion ×1

sudo ×1

terminal ×1