Using local VNC connections on Mac to access other user accounts

If you have multiple user accounts on your Mac but don’t want to use the Fast User switching functionality, here is a small trick to quickly access them.

First step: SSH to your local machine and port-forward port 5900 (where VNC listens) to 5901 (can be anything you want):

ssh -NL 5901:localhost:5900 localhost

Now open the Screen Sharing tool and enter ‘localhost:5901’ as your destination. You will get the familiar login screen where you can choose another user and view their Desktop. All without logging out your current user!