Smb-user-add

From SOFTICE

Jump to: navigation, search


Developed by:

Synopsis

This script creates the specified Samba account on the SOFTICE cluster. It is located at /home/sys/bin/smb-user-add.

File

#!/usr/bin/expect
# copyleft Matt Rideout, SOFTICE project, 2007/09/14
# file:         $SOFTICE_ROOT/osc/bin/smb-user-add
# chmod:        only executable by root
# credits:      inspired by autopasswd script available at http://expect.nist.gov/example/autopasswd

# Create Samba user account with specified login name and password

# Expected Parameters:
# $1 student login name
# $2 password

set password [lindex $argv 1]
spawn /usr/bin/smbpasswd -a [lindex $argv 0]
expect "New SMB password:"
send "$password\r"
expect "Retype new SMB password:"
send "$password\r"
expect eof
Personal tools