4

I am using today the command adduser of linux with OS library. But would like to use the python libuser for administrative commands as add a new user.

Ismael Vacco
  • 1,010
  • 1
  • 10
  • 24
  • Possible dup: http://stackoverflow.com/questions/3190955/how-to-create-a-user-in-linux-using-python – Diego Herranz Oct 09 '13 at 17:02
  • 2
    Diego Herranz, it don't a duplcate. I would like how to create an user in linux using the libuser. This ask show only how to create an user in linux. – Ismael Vacco Oct 09 '13 at 18:09

1 Answers1

4

See the creation of the jimbo user in https://pagure.io/libuser/blob/master/f/python/test-script

Phil P
  • 792
  • 5
  • 10
  • On your script I am having following error: `SystemError: could not open configuration file `/etc/libuser.conf': No such file or directory` – alper Jul 05 '20 at 15:52
  • Not my script, I pointed to an existing script which is part of the libuser codebase. Looks like the library code requires the config file to exist. So, perhaps create it? – Phil P Jul 06 '20 at 18:17
  • Also should I run the script with `sudo`? – alper Jul 07 '20 at 19:10