Screen Share With Another Account On the Same Mac

You can share the screen of another Mac pretty easily. But it seems like it is impossible to do the same with another account on the same Mac. However, if you use Terminal to set up an ssh tunnel, you can share the screen of a second account using an alternate port number. This allows you to stay logged in to one account, while you use another account in a screen sharing window.
Video Transcript / Captions
Closed captioning for this video is available on YouTube: Screen Share With Another Account On the Same Mac.

If you use Screen Sharing you know how handy it can be. You can use it to see the screen of one Mac on another Mac. For instance, you can use your laptop Mac while traveling to see the screen of your desktop Mac and control it. But you know what will be useful sometimes is the ability to control another user on the same Mac. So, for instance, you would be able to have two accounts on the same Mac and be able to, instead of switching to the other account, stay in the current account but open up a screen sharing window and control the second account.

However, it looks like you can't. If you try here's what happens. I'll do Command K to select the Connect to Server interface here and then the proper way to screen share is vnc://localhost. Local host is basically this machine. You can use your IP address too. But if you say Connect you get You cannot control your own screen. So it seems you can't do it. But there is a way.

So the first thing is you want to make sure that you have everything enabled that you need. So under System Preferences, Sharing, of course you have to have Screen Sharing turned on. This is in the second account. The one I'm going to be going to. So make sure Screen Sharing is turned on. But you also going to need Remote Login turned on. So make sure those are both on.

Then, while you're still in this account that you're going to be going to, you're going to open up Terminal. In terminal I'm going to use a command, ssh space dashNL space 5901:localhost:5900 space localhost. What does this do? Well what this does is it will create a tunnel saying that you can go from port 5901 to port 5900. 5900 is screen sharing. So going into port 5900 to screen share is giving you that message. But, 5901 won't. So I'm going to run this. It's going to ask me for my password because I'm doing something that I need to authenticate.

So I enter my password and then it kind of freezes. It's actually running. This terminal window is now engaged in being a tunnel taking everything going from port 5901 to port 5900. Now I can switch to my main account and screen share into this one. So now I'm going to use Command K to initiate screen sharing and it's going to bring up the Connect to Server window here which I'm then going to use vnc://and then the user name, macmost@ localhost and then here's the key, colon5901. To it's going to say I'm going to connect, but not using 5900 the default for vnc, but 5901.

I hit Connect and now it goes through. It doesn't give me the message that I can't do it. So I can login and choose whether I just want to view or Control. I connect and then here in the screen sharing window, in the Screen Sharing app here, I've got a window into this other user account. I'm logged in and using both user accounts at the same time. This is the one in Screen Sharing, that's my MacMost account, and this is my main user account here with it's regular interface. So I can control the second user account while still really in the first user account.

Comments: 5 Responses to “Screen Share With Another Account On the Same Mac”

    3 months ago

    The Terminal answer to “ssh -NL 5901:localhost:5900 localhost” is:
    “The authenticity of host ‘localhost (::1)’ can’t be established.
    ECDSA key fingerprint is SHA256:LO93WIYmRr5QACGc3TgnHdcnKPE7ttlfSm4K9LDi0rc.
    Are you sure you want to continue connecting (yes/no)?”
    Is it ok to go on?

    3 months ago

    Vasco: Yes. I believe that is just looking for a certificate to verify it is you. But you don’t need one as this is your machine, not some public server. You can trust yourself :)

    Dennis Linthicum
    3 months ago

    I have long had two accounts and spent numerous hours switching back and forth. Looks looks like a great solution.

    I am having trouble though… 1) In your example “macmost” I believe is your username, right? I am being asked for a password after the SSH command, and it appears to not like either password. Let’s say, I have two accounts, UserA and UserB… after the SSH terminal command should I give, A or B password? (BTW, the password for A is also the root password, which is why I ask.

    3 months ago

    Dennis: I believe it wants the root password.

    3 months ago

    ARD into your “work account” and then do the following on the remote computer to open a Screen Sharing window to your “personal account” on the same remote computer.

Comments Closed.