11
« on: December 16, 2003, 01:27:03 pm »
i had the same troubles tcoulon... it pretty much means you gotta add the user yourself ...
the way to do it is you\'ll need to edit the /etc/passwd file, /etc/group and /etc/shadow ... i will further in-depth now..
first, /etc/passwd - this file contains basic unshadowed information about the user... the users already there give pretty good examples to work off of, and you can figure out what you want from looking at it:
example:
joe:x:1000:1000:root:/home/joe:/bin/bash
note: everything in these files is delimited by a colon( : ) ...
the first field is the username, the second field, in old unix implementations would contain the \"unshadowed\" (plaintext) passwd, obviously this isn\'t the case anymore, so it just contains an \"x\" as a placeholder. the third and fourth fields are the uid and gid. The uid should be a unique number, 100 is a good one to start with asmost distros will automagically start making new users at 100 then increment from there. The gid us the unique id associated with the user\'s group. It should be 100 for most non-priv\'d users, as this is the gid for users, ill cover this further down the road. the fifth field is the user\'s full name, i beleive (i could be wrong and am too lazy to look at the man ) ... the sixth field is the user\'s homedir and the seventh is the user\'s shell of choice , bash is pretty much your only choice for cacko-x11 (ksh anyone? )
next is /etc/group which holds a list of groups, and what users are \"Attached\" to each group
users:x:100:joe
the first field is the group\'s name , the second is the deprecated passwd field, again, the third is the unique gid for that group ( also the fourth field in the /etc/passwd file) and the last field is a comma-seperated list of users belonging to that group. remember, if the group in question in the user\'s \"main\" group, then the fourth field of that user\'s entry in /etc/passwd should match up with their \"main\" group\'s gid. This is so that a user can be in multiple entries in /etc/group, but still have one primary group that new files made by them will be associated with. If you plan on doing much su or sudo type stuff, to avoid having to log in as root as much, then id recommend also adding the user to the \"wheel\" group.
the last file is /etc/shadow
joe::10933:0:99999:::
ok, this one is a little wierd, but ill break it down like this:
the first field is of course, the user\'s name. The second one should hold either A) nothing (like in this case), means there is NO PASSWORD for that account (ie you just type username, and hit enter twice to log in), this is how root\'s account will after setup. an asterisk (*) which means there is no passwd, period. i.e. there is no right passwd, so you can\'t log in. or C) if you have actually set a passwd, there\'ll be a bunch of gibberish (an md5 hash i guess). you\'ll prolly want to leave it empty like in case A, then log in and set a passwd, just to play it safe. the third field isthe number of doans btween jan 1, 1970 and the date when the passwd was last changed. This really doesnt matter, all the others say 10933 in cacko\'s /etc/shadow, so i decided to follow suit. the fourth field is the min number of days between passwd changes, this is 0, the fifth is the max number of days. we set to 99999 so that it\'s like 273 years or somethin like that. The next field is the number of days prior to passwd expiration to warn the user, suffice to say you\'ll be pretty old by the time you get that message. The next three fields are inactive, expire and flag .. and are pretty much alwasy left blank for every day use.
Basically with the information above, you can hand-fabricate your own users, and if you\'d like more information, check out the passwd(4), group(4) and shadow(4) manpages.
update: upon reviewing this post, ive realized how encyclopedic it is in nature .. whoops .. but hey, if you manage to make it all the through then more power to ya! :roll: