#! /bin/bash # Execute this script to add a new user to the cluster globally echo ' ' echo 'Existing users in /etc/passwd of '$HOSTNAME cat /etc/passwd | awk -F":" '{print $1, $3}' | awk '{if($2>=1000 && $2<4000) {print}}' | sort echo ' ' read -p "Enter username to delete: " username /share/apps/local/bin/coc-sshreachable hosts=$(cat /share/tmp/ssh-reachable.dat) for rn in $hosts do command='userdel -rf '"$username" echo 'delete user '"$username"' in '"$rn" echo $command pdsh -R ssh -w "$rn" $command done echo user $username has been deleted from the cluster