Restrict port forwading, sftp, and pty via Tailscale environment variables available in an unstable release 1.53.120 or later. Typically you would do this by adding the following to /etc/default/tailscaled with:
Create a CSV that maps Tailscale login names to the specific command and arguments to run for each user.
user1@example.com,/usr/bin/echo Hi user1
user2@example.com,/usr/bin/hg-ssh /home/hg/repo
Modify tailscale-ssh-exec.sh to specify the CSV file from the previous step and customize any additional arguments to tailscale-ssh-exec - e.g. -v to enable verbose logging; helpful for troubleshooting during set up.