Create user from python script?

solshark

New Member

Reaction score: 1
Messages: 3

Hello.
How could I create user automatically with specified username, homedir and random password?
I'm going to call something from python script:
Code:
add_user_command = "adduser -w random -d " user_sites_dir + " " + system_username
os.system(add_user_command)
Any advice?
 
Top