Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Bulk user add with passwords bash script

echo -e "Enter file path: c"
read -r userfile
echo
for i in `more $userfile`
do
        sudo useradd $i
        echo "User $i added!"
        echo "Setting user $i password..."
# Below line will generate a password like john@linux        
        password="${i}@linux"
        echo -e "$password
$password
" | sudo passwd $i
        echo "User $i password set!"
        echo
done
Comment

PREVIOUS NEXT
Code Example
Shell :: Media change: please insert the disc 
Shell :: ubuntu fresh install deps 
Shell :: copy linux command with all hiden files 
Shell :: bulk folder creation by windows powershell 
Shell :: brew install shopify-cli Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)! 
Shell :: command displays all the commands ran previously on the terminal 
Shell :: heroku config:set NPM_CONFIG_PRODUCTION=false YARN_PRODUCTION=false ERROR 
Shell :: push to an existing branch 
Shell :: Payload ftp download upload 
Shell :: remove a complete directory 
Shell :: install postgresql and phppgadmin client 
Shell :: see prerouting rules linux 
Shell :: how to connect to the google in linux 
Shell :: git lfs track folder 
Shell :: install ubuntu along windows not showing up , even with unallocated space 
Shell :: surfshark linux cannot install 
Shell :: linux bash shell join path 
Shell :: node_modules permission mkdir 
Shell :: cuddn version check 
Shell :: Authentication required. System policy prevents WiFi scans 
Shell :: authorized by ssh without password 
Shell :: git Ambersafety 
Shell :: check if file contains string bash 
Shell :: Warning: Pub installs executables into $HOME/.pub-cache/ 
Shell :: DISABLE_DATABASE_ENVIRONMENT_CHECK=1 
Shell :: basic config palo alto cli 
Shell :: How to update extension on knime server 
Shell :: laravel sail 
Shell :: where is zshrc in big sur 
Shell :: Stop ssh connection after execute a script 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =