Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Son of BASH!
Message
General information
Forum:
Linux
Category:
Other
Title:
Miscellaneous
Thread ID:
00451468
Message ID:
00454519
Views:
24
>>I looked at the source for Kmuser. It is *very* slick and well written. It uses qt widgets to add users, accounts, passwords, etc.... I can use it as a source for ideas to write a pgm to do what I want.
>
>Does it call 'adduser' or 'useradd' to create the users? You could modify the code it uses.
>
>>I don't know that much about awk or how the password and shadow file works.
>>But, AFAIK, changing the names in those two files will not automatically delete the old account directories and create the new ones, even if that changes the names of the accounts. That would put me in a worse mess.
>
>No, it doesn't automatically do it, but you can do it. All you have to do is change the username in /etc/passwd and /etc/shadow (and group memberships other than their primary if neccessary). Then change their home directory in /etc/passwd too, rename the existing directory, chown -R the directory (plus any other files they may have owned, but if they are a new user, there shouldnt' be any). Programmatically, that is not a chore. Awk (and its variants) just uses reg ex's. It's simple.
>
>>That raises a question I wanted to ask: Are the /etc/password and /etc/shadow files the only places where account names and info are kept, or is there a database file someplace else?
>
>Basically, yes. Those are the only places. Unless of course you are automatically creating accounts or doing some sort of security auditing based off the password files.
>
>j

You gave me an idea Jason!
I could do it backwards. Since password and shadow contain all the user info,
I copy those files to the new hd and then write a script to create the user account and copy "bbs_login" to each account. That would be easy!
Thanks!
JLK
Nebraska Dept of Revenue
Previous
Reply
Map
View

Click here to load this message in the networking platform