0

Previously, screen sharing to Catalina (10.15.7) from Big Sur (11.1) using terminal:

open vnc://[user]:[password]@[host].local

would open a screen sharing session without having to enter a password.

After the Big Sur 11.2 upgrade, Catalina now displays the login screen and asks for the password.

How can I correctly pass the password to the screen sharing session and bypass the login screen?

0

I've noticed that too but couldn't figure out how to properly pass credentials into VNC either.

The docs for screen sharing say that if both machines are signed into the same iCloud account, then a screen sharing session will begin. Otherwise a username password prompt is displayed. I didn't see much difference between the Catalina and the Big Sur versions of the page unfortunately.

If you want a work around, I hacked together some Apple Script that will open up the screen sharing app, fill in hostname, username/password, then re-enter the password on the remote machine and press enter:

tell application "Screen Sharing"
    activate # start Screen Sharing if not running yet
    tell application "System Events"
        key code 51 using {command down} # Delete whatever is in the textbox
        keystroke "192.168.1.1" # host you want to connect to
        key code 36 # press enter
        delay 1 # wait a moment for the next screen to appear
        keystroke "username" # username
        keystroke tab
        keystroke "hunter2" # password
        key code 36 # press enter
        delay 2 # wait to connect to the target machine
        key code 51 using {command down} # delete anything in the textbox
        keystroke "hunter2" # typing the password on the remote machines textbox
        key code 36 # hitting enter to log in
    end tell
end tell

To use throw the above code into a file called file.scpt and run it via osascript file.scpt. You need to give the Terminal app the Accessibility permission within the Security & Privacy section of the Settings app.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .