||2 months ago|
|.gitignore||2 months ago|
|README.md||2 months ago|
|config.example.toml||2 months ago|
|go.mod||2 months ago|
|go.sum||2 months ago|
|main.go||2 months ago|
|usercreate.go||2 months ago|
This is a interactive cli Go program to add a new user to FreeBSD or Linux. It assumes you already have a working zfs setup and want to create a new dataset for each new user. The user enters their username, password, and ssh key (all subject to validation checks). Zfs quotas are used to limit each user's home directory to a certain size.
The intended use case for this script is people connecting over ssh to a specific user; that user should be limited by the sshd config (Match to the user and ForceCommand to this script) to only run this script. As they are creating users and zfs datasets, they will need superuser permissions on the script.
The script now asks for a user password. If you intend to allow users to mount zfs datasets in their home directory without superuser permissions, you must set
The script expects extra files that should be copied to a user's home directory to be in the
SkeletonDir. If an .ssh directory is not copied from the skel directory to the user's home, the script will create the folder
This has not been tested extensively, so please do your own testing if you choose to rely on it for important stuff.