OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Adding a user
tcoulon
post Dec 15 2003, 02:53 PM
Post #1





Group: Members
Posts: 40
Joined: 14-September 03
From: Froideville
Member No.: 429



Hello,

So I decided to use this new X11 ROM, I did it and yes, it's real cool. Always dreamed of seing my Z behave like a *real* linux box should and it does now. I think I'll send money smile.gif)

Being a regular Linux user, I however hate to live as root. I tried the "adduser" command but it seems it won't do anything but answr with it's syntax. Anyone's got a solution?

Thierry
Go to the top of the page
 
+Quote Post
enki
post Dec 16 2003, 10:27 AM
Post #2





Group: Members
Posts: 35
Joined: 2-July 03
From: Str8 N0rth C4k4l4ky
Member No.: 232



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 tongue.gif ) ... 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? tongue.gif )

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. cool.gif 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:
Go to the top of the page
 
+Quote Post
tcoulon
post Dec 16 2003, 11:48 AM
Post #3





Group: Members
Posts: 40
Joined: 14-September 03
From: Froideville
Member No.: 429



Thanks, I'll try it

Thierry
Go to the top of the page
 
+Quote Post
post Dec 17 2003, 02:03 AM
Post #4





Group:
Posts: 0
Joined: --
Member No.: 0



thanks , it's ok!!
Go to the top of the page
 
+Quote Post
post Dec 25 2003, 03:45 PM
Post #5





Group:
Posts: 0
Joined: --
Member No.: 0



hello enki !

i followed your instructions how to add user "manually".


it worked for me as long as i did´t add a passwd via the passwd <username> command.

when i add a user (in /etc/passwd, /etc/group and /etc/shadow)
it works fine when i don´t add a password.

after:

passwd <username>
entering password
re-entering password
logout

i can´t re-login on X with this username and its password.
did i do something wrong ?

perhaps you can help me ?



thanks

ollie
Go to the top of the page
 
+Quote Post
enki
post Jan 5 2004, 07:51 PM
Post #6





Group: Members
Posts: 35
Joined: 2-July 03
From: Str8 N0rth C4k4l4ky
Member No.: 232



hmmm ollie... ive never encountered anything like that... the way i usually do it is i first add the user with no passwd, as in the manner i described above... then i log in as the user, and just do 'passwd' with no follow username ... and im able to change the passwd and log out then back in just fine...

sorry for the late response, i was on vacation
Go to the top of the page
 
+Quote Post
UseEncryption
post Jan 6 2004, 05:22 AM
Post #7





Group: Members
Posts: 9
Joined: 31-December 03
From: Cincinnati
Member No.: 1,314



I've had a similar problem on my desktop. Turned out that the passwd command can handle some crazy number of characters (256ish perhaps?) , but the login screen variable was truncated at 8. When at a terminal, you can whack away and create a properly secure passsword (define as you wish, but more than 8 chars anyway), but when you actually try to use it, it is never correct as nothing after the 8th character is ever compared to the shadow value. I changed desktops to one that had a larger buffer, but perhaps you could try a shorter password?

And while we're on it... the ":x:" in
joe:x:1000:1000:root:/home/joe:/bin/bash
is a placeholder that replaces a hash of the password. Even way back whenever it was, they knew better than to expose plaintext passwords. :)
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd December 2014 - 03:26 PM