def setUserDetails(username, name=None, password=None, aliases=None): debugOutput("Setting details for %s name %s password %s" % (username, name, password)) system.updateUser(username, name=name, password=password) if password and username in samba.getUsers(): samba.setPassword(username, password)
def setAdminPassword(password): # Set samba admin password samba.setPassword("root", password) # Set web interface admin password system.run("htpasswd -bc %s '%s' '%s'" % (PASSWORD_FILE, "Administrator", password)) system.run("chgrp www-data '%s'" % PASSWORD_FILE) system.run("chmod 740 '%s'" % PASSWORD_FILE)