Answers:
在命令行中,您必须找到Unix可执行文件并使用sudo运行它,如下所示:
$ sudo -u Bob /Applications/Firefox.app/Contents/MacOS/Firefox
…或与su相同:(但是这也需要您为root设置密码-我不建议这样做)
$ su Bob
$ /Applications/Firefox.app/Contents/MacOS/Firefox
(…或一行以上:)
$ su Bob -c /Applications/Firefox.app/Contents/MacOS/Firefox
过去,PPC Mac的最简单方法是使用Pseudo,但长期以来一直停产。这是将应用程序图标拖放到Pseudo的图标或窗口上。
Trace/BPT trap: 5
sudo
方法时,即使我为其他用户使用了正确的密码,也会遇到登录失败的情况。su
另一方面有效(没有密码用于根集)
请参阅/apple//a/102105/1860,了解为何su
并非对所有应用程序都有效。
最新版本的launchd
可以在另一个用户的会话中启动应用程序;尽管Apple工程师不建议使用它。
使用launchctl中的bsexec
选项定位适当的用户会话:
bslist [PID | ..] [-j]
This prints out Mach bootstrap services and their respective states. While the namespace
appears flat, it is in fact hierarchical, thus allowing for certain services to be only avail-
able to a subset of processes. The three states a service can be in are active ("A"), inactive
("I") and on-demand ("D").
If [PID] is specified, print the Mach bootstrap services available to that PID. If [..] is
specified, print the Mach bootstrap services available in the parent of the current bootstrap.
Note that in Mac OS X v10.6, the per-user Mach bootstrap namespace is flat, so you will only
see a different set of services in a per-user bootstrap if you are in an explicitly-created
bootstrap subset.
If [-j] is specified, each service name will be followed by the name of the job which regis-
tered it.
bsexec PID command [args]
This executes the given command in the same Mach bootstrap namespace hierachy as the given
PID.
bstree [-j]
This prints a hierarchical view of the entire Mach bootstrap tree. If [-j] is specified, each
service name will be followed by the name of the job which registered it. Requires root priv-
ileges.
推荐的方法是编写启动的作业凭单,然后重新启动Mac-或要求用户注销并再次登录。
您需要ssh。即ssh username@123.456.00
。如您所说,您将需要用户密码。然后,您可以执行自己的要求。您需要在“系统偏好设置”>“共享”下启用远程登录:
然后,您可以这样做,open -a Firefox
并且Firefox将以其他用户而不是您的用户身份打开。
LSOpenURLsWithRole() failed for the application /Applications/Firefox.app with error -10810.
尝试open -a Firefox
:-|时
sudo open -na Firefox
su
如果不愿意,它也适用sudo
。谢谢!