0
Good afternoon guys I am building a script to create user and password on linux (Ubuntu 16.04LTS). The problem is that after running my script the user is created but I can’t log in with the password that was passed by the script. Anyone know why?? Thanks for your help.
import subprocess
import sys
#criar usuario e senha
nome = input('Digite o nome do usuario: ')
senha = input('Digite a senha do usuario: ')
dominio = input('Digite o Dominio: ')
# user
user_sufix = nome
user_name = 'teste_' + user_sufix
# password
user_pass = senha
# domain
domain = dominio
#Cria o usuario na maquina
useradd_result = subprocess.run(["sudo", "useradd","-m","-p",user_pass, "-s", "/bin/bash",])
#passwd_result = subprocess.run(['sudo','passwd',user_name,user_pass])
Thanks William. I got it here.
– Junior Medeiros