I\'m trying to automate the setup of SFTP access. This script is running as a user with sudo permissions and no password.
I can create a user like so:
On Ubuntu, use usermod
class SomeClass def userPasswd(self, login, password): encPass = crypt.crypt(password) command = "usermod -p '{0:s}' {1:s}".format(encPass, login) result = os.system(command) if result != 0: logging.error(command) return result