#!/bin/sh # addmachine # add machine user account to /etc/passwd and /etc/samba/smbpasswd # # this is called with parameters: # $1: machinename (with NO $, it will be added) # check to see if $1 is empty (i.e. addmachine called with no parameters) # if so, prompt for machine name to add # Written by: Jerry Winegarden, 2/18/04, GPL # ------------------------------------------------------------------- echo "Create smbpasswd machine accounts echo "(necessary for domain logins from samba server)" if [ "$1" = "" ] ; then echo -n "Add Microsoft Network Neighborhood account for machine name: " read mn if [ "$mn" = "" ] ; then echo "Error. You must enter a machine name to add." echo "Quitting." exit fi else export mn=$1 fi /usr/sbin/useradd -g 100 -d /dev/null -c $mn -s /bin/false $mn$ passwd -l $mn$ smbpasswd -a -m $mn