Log in to OSX via the command line

I want to be able to authenticate using the login window through the command line. I do not know if this is possible, but if so, I would very much like to know how this is done.

I developed a process called "loginwindow", but I cannot decide how to pass any parameters to it.

Thanks.

+4
source share
2 answers

Something like that:

#!bin/sh cat >/tmp/Login_Automatically.sh <<-"EOF" if [[ "$(who | grep console)" == "" ]]; then # Runs ONLY if no one is logged in osascript <<EOT set username_ to "username" set password_ to "password" tell application "System Events" 

(via http://hints.macworld.com/article.php?story=2010021119293586 )

In addition, you can’t disable authentication all together in the system settings, if you want to bypass the login?

Or, if you want to kill him, read: Kill the "loginwindow" process using the command line in Mac OS X

0
source

The solution was in the comments of this article .

Copy and paste the command line / ARD:

 osascript -e 'tell application "System Events" to keystroke "usernamegoeshere"'; \ osascript -e 'tell application "System Events" to keystroke tab'; \ osascript -e 'tell application "System Events" to keystroke "passwordgoeshere"'; \ osascript -e 'tell application "System Events" to keystroke return' 

Thanks to Sam Mirrado for providing the link to the article.

Source Comment by engelby Feb 16, '10 02:09:32 PM.

0
source

Source: https://habr.com/ru/post/1432065/


All Articles