A custom script is needed to do this.
In terms of database records, every user is required to have a record in each of these tables:
xf_user
xf_user_authenticate
xf_user_option
xf_user_privacy
xf_user_profile
Passwords go into xf_user_authenticate.
Permissions would be a function of the group ids in the xf_user record. You can rebuild the user cache to calculate the permissions after modifying the xf_user records:
Admin CP -> Tools -> Rebuild Caches