Skip to content

IbeChuksVictor/shell-script-users

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Add mulitple users to a Linux server.

Shell Script to create multiple users from a list of names in a file.
The script;

  • Checks for user's permission to run script.
  • Searches for a file named users.csv, where names for users are listed in the current working directory.
  • Checks if user group developers exists. If not create user group.
  • Check if users to be created with usernames listed in file already exists. If it does, add user to supplementary group developers.
  • Create new users with username listed in file.
  • Creates .ssh directory in the home directory of users and assign appropriate user permissions to the directory.
  • Generates SSH connection authorisation keys for each user in the .ssh directory.

Usage:

Run script with user that have root privileges like thus:

   $ sudo ./adduser.sh

Delete mulitple users from a Linux server.

Shell Script to delete multiple users from a list of names in a file.
The script;

  • Checks for user's permission to run script.
  • Searches for a file named users.csv, where names for users are listed in the current working directory.
  • Check if users to be deleted with name listed in file already exists. Skip if it doesn't.
  • Delete existing users and their home diectories with usernames listed in file.

Usage:

Run script with users that have root privileges like thus:

   $ sudo ./deluser.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages