Hi,
I want using my c++ program delete, add and change users on my linux box (the linux-users themself yes). How should I do this?
Hi,
I want using my c++ program delete, add and change users on my linux box (the linux-users themself yes). How should I do this?
Why do you want to program something that your shell can do?
There is the system() function from <cstdlib> that allows you to call outside programs. Or you could read in and edit the user files manually.
A simple menu interface calling the useradd, usermod and userdel programs would seem to be in order.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Yes, that's what I was thinking about as well. However, when I type useradd username, I get different questions, like the password, full name, room number, etc. How can I include these things in the command useradd?Originally Posted by Salem
If you specify everything on the command line, do you still get interactive questions?Code:useradd [-c comment] [-d home_dir] [-e expire_date] [-f inactive_days] [-g initial_group] [-G group[,...]] [-m [-k skeleton_dir] | -M] [-n] [-o] [-p passwd] [-r] [-l] [-s shell] [-u uid] login
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
No, no more,
Thank you