{"id":17287671,"url":"https://github.com/taraspos/cruser","last_synced_at":"2025-04-14T11:06:36.743Z","repository":{"id":64307401,"uuid":"76198958","full_name":"taraspos/cruser","owner":"taraspos","description":"Create Linux users from list of SSH keys. ","archived":false,"fork":false,"pushed_at":"2016-12-26T22:16:07.000Z","size":910,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T11:06:31.721Z","etag":null,"topics":["linux","ssh-key","user-creation","user-management"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taraspos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-11T20:46:27.000Z","updated_at":"2023-02-07T19:21:19.000Z","dependencies_parsed_at":"2023-01-15T11:00:36.433Z","dependency_job_id":null,"html_url":"https://github.com/taraspos/cruser","commit_stats":null,"previous_names":["taraspos/cruser","trane9991/cruser"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taraspos%2Fcruser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taraspos%2Fcruser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taraspos%2Fcruser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taraspos%2Fcruser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taraspos","download_url":"https://codeload.github.com/taraspos/cruser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868768,"owners_count":21174757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux","ssh-key","user-creation","user-management"],"created_at":"2024-10-15T10:06:01.015Z","updated_at":"2025-04-14T11:06:36.719Z","avatar_url":"https://github.com/taraspos.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [CR]eate [USER] -\u003e cruser\n\nTool to create users on Linux system. \n\nMechanism of users creation are inspired by Google Cloud, when username are automatically taken from SSH-key(and email after).\n\nList of users are need to be provided in the **authorized_keys** file format.\n\n## Requirements \nTool don't use any external libraries, but relies on some default(in most Linux distros) CLI tools:\n* `id` - used to check, if user exist in the system, get user's *gid* and *uid*\n* `useradd` - used for user creation\n* `visudo` - used for validation of sudoers lines\n\n## Example:\n* File *users*:\n```\nssh-rsa aaaaaaaaaaaaaaaaaaaaaa test@gmail.com\nssh-rsa bbbbbbbbbbbbbbbbbbbbbb test@gmail.com\nssh-rsa cccccccccccccccccccccc hello@gmail.com\nssh-rsa cccccccccccccccccccccc hello@gmail.com\n```\n\n* Result of running command `cruser -file users` will be:\n    * Created users **test** and **hello**\n    * Sudoers lines are generated and validated with **visudo**\n    * Line `test ALL=(ALL) NOPASSWD:ALL` added to the file */etc/sudoers.d/test*\n    * Line `hello ALL=(ALL) NOPASSWD:ALL` added to the file */etc/sudoers.d/hello*\n    * Provided SSH keys are added to the */home/test/.ssh/authorized_keys* and */home/hello/.ssh/authorized_keys*\n    * Duplicated lines are skipped\n    * **test@gmail.com** and **hello@gmail.com** are added as comment entry in the */etc/password* file\n\n## Build:\n```\nmake build\n```\n\n## Running demo:\n```\nmake demo\n```\n\n## Missing features:\n* Adding SSH-keys for existing users. Currently only newly created users supported\n* Reading SSH-keys list form remote location(S3, github, etc)\n* More flexible Sudoers configuration(only NOPASSWD:ALL are supported now)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaraspos%2Fcruser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaraspos%2Fcruser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaraspos%2Fcruser/lists"}