使用python添加用户

#!/usr/bin/env python
#utf-8
import os
import crypt

username = raw_input("whats your name:")
password = raw_input("password:")
enc_pass = crypt.crypt(password, "22")

os.system("useradd -d /home/" + username +" -u 666 -p " + enc_pass+" " + username)

你可能感兴趣的:(使用python添加用户)