add_new_user.sh: add user 'wadmin'

This commit is contained in:
2018-11-16 04:44:37 +01:00
parent 724f79c926
commit dacfd9919a
2 changed files with 14 additions and 1 deletions

View File

@@ -135,6 +135,12 @@ if $password_needed ; then
elif [[ "$user_name" = 'chris' ]]; then
perl -i -n -p -e "s#^(${user_name}):[^:]+:(.+)#\1:\\\$6\\\$RWYCSssQ\\\$mtcJJELuc3.onwAhyVk4zdFLGaKw.XNfpM/mEZEJfZIyZZwUApwgoMcWkly7dwv0X4FpJVQ.oxJNnitHp7Ar70:\2#" /etc/shadow
# - wadmin
# -
elif [[ "$user_name" = 'wadmin' ]]; then
perl -i -n -p -e "s#^(${user_name}):[^:]+:(.+)#\1:\\\$6\\\$vaVNOPYp\\\$RbV6/phKDZRSa4TQGlJVOF/HQqyxAK7BeQmir8Kr8pwy7ATlHGvcPzJkuldNNp4O4t2q3EJRW2uVpjsng4ZhH1:\2#" /etc/shadow
# - root
# -
elif [[ "$user_name" = 'root' ]]; then
@@ -220,7 +226,7 @@ fi
chmod 700 ${home_dir}/.ssh
chown -R ${user_name}:${user_name} ${home_dir}/.ssh
if [[ "$user_name" = 'sysadm' ]] || [[ "$user_name" = 'chris' ]] ; then
if [[ "$user_name" = 'sysadm' ]] || [[ "$user_name" = 'chris' ]] || [[ "$user_name" = 'wadmin' ]] ; then
usermod -a -G sudo ${user_name}
fi
#ls -al ${home_dir}/.ssh