0

I need to create a user with home directory in python. Currently, i am doing this:

adduser --home /test testing

But, this requires some inputs as well. How do i execute such command and give the input in python?

Input is asking password, room number, and etc.

Thank you

  • 2
    Does this answer your question? [How to create a user in linux using python](https://stackoverflow.com/questions/3190955/how-to-create-a-user-in-linux-using-python) – Tsyvarev Aug 21 '21 at 13:12

1 Answers1

1

You can use useradd instead of adduser you can specify the password and more via in CLI (I guess you are or should use subprocess)

Please note in future as per SO guideline first search for similar questions before asking a new question. For example the answer to your question can be found here

garlicFrancium
  • 2,013
  • 14
  • 23