I have an NFS directory that is using file-based authentication.
There is no such thing as "file-based authentication". You are probably using "UNIX authentication".
How do I read/write to this directory, using the
uids that I have retrieved from the server? Should I create a local user with the same
Yes. One sane way to manage an NFS network is to have the same
uids across all systems. For large networks, this is best done with a distributed authentication mechanism such as NIS, Kerberos, or LDAP.
Side question, how does my password play into this? If someone gets my
uid (which seems small and brute-forcable), can they easily read/write into my directory?
Absolutely. From a security perspective, NFS is like an open barn door. It was initially designed for LANs where every host is trusted.
You can run NFS over VPN, but you must still trust every VPN member. Bottom line, if you care about security you shouldn't be using NFS at all, there are tons of better solutions for distributed data these days.
Update: By way of suggesting a specific solution rather than saying "tons", you can use FUSE
sshfs to securely connect to a specific user's directory over SSH, secured by the usual SSH protocols.