RH 5.0 and adduser

I have installed RH 5.0 and am now having problems adding users.

I use the command line  adduser -r username -p password -m
i have tried without the -m and i have tried a lot of other paramaters as well.  
I have also tried inside X-Windows and no luck there either.

It is loading up the user and creating the home directory but can't login.

is there any files i need to have in their home directory for them to log in??

Please lemme know how I can get users to be able to login.

-- Dane
LVL 2
Dane PickeringAsked:
Who is Participating?
 
sortofConnect With a Mentor Commented:
to make a user, type:  

adduser [username]

then type:

passwd [username]

and it will prompt you for a password.  hit ctrl+d or whatever to login as a new user (not from x) then you should be able to login as that user and everything should work fine.
0
 
ahoffmannCommented:
check following fields from the user-line in /etc/passwd:

   homedirectory  - does this directory exist?
   login shell    - does this shell exist on your system *and*
                    is this shell listed in /etc/shells

as root, can you make:
   su - newuser
0
 
nigesCommented:
What do you mean "make su - newuser" do you mean type that out or actually issue a make command on it like building a kernal??

or do you just type "su - newuser"??

--Nige
ps Dane will prob. read this today and try it out...
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
nigesCommented:
I have the same system as Dane and I am having the same problem. We both installed RH5.0 is this some sort of bug in that release that has to be fixed???            

--Nige      
0
 
Dane PickeringAuthor Commented:
Ok,

I have logged in as root, created the account, tried to log in - no go, had a look in the passwd file and the info in there is right, also the info that comes up when you finger an account is there, all ok, home dir, shell, i even went into the users home directory and created a .plan and it saw that as well..  Though when i went into the home dir i couldn't find it..

any ideas why can't see the .plan and still need to work out how to log in with a freshly created user..

niges will match my 50 points to whoever can figure this one out.

-- Dane
0
 
ahoffmannCommented:
Dane, reading your comment confuses me

    look in the passwd file and the info in there is right,

and later

    Though when i went into the home dir i couldn't find it..

So it's defenitely *not* right, exactly what I want to know in my first comment. Please create the directory which is listed in passwd.

niges,
    su - newuser
should be typed literaly as you can see it here, except that you replace the literal  newuser  by the account name of this user (first word in passwd).
0
 
Dane PickeringAuthor Commented:
Ok,

by the info in there i mean in the passwd file, though there are a whole lot of lines
I can't post them now as i am at work, all to do with settings, it has listings for all of the users..

when i go into the passwd file the new user that i added is the last entry in there and from what i can rememer it is in the format password:username/home/dir:/bin/shell (it was something close to that..)

when i was talking about "Though when i went into the home dir i couldn't find it.. " I mean that when i went to look for the .plan file in the home directory (as root) i couldn't see it.

I will let nige know about su..

0
 
nigesCommented:
Thanks ahoffman. This problem is really irritating as it is RedHat 5.0 installed off the CD and it should be already setup to add users in the default way!! What a bastard. When I get home from uni I will try that out...

--Nige
0
 
nigesCommented:
Also one other thing, why should we create the directory listed in the passwd file, shouldn't the adduser command be creating the directory for us???

I think the problem lies in the uid or gid settings, or maybe in the password as when we try using the new username and password to login, it says login incorrect.....

But the user exists.

Unless there is a setting that it only allowing some sort of logins eg root can only login locally and no-one else, that we have to change???

--Nige
0
 
ahoffmannCommented:
niges, IMHO adduser should do it right, ask at RedHat (or read man-pages).

Anyway, you passwd should have a line as follows

newuser:crypted_password:1087:111:newbie:/usr/home/dir:/bin/sh

the fields are seperated by colons (:), what I asked for are the last 2 fields. Please answer my question if we should help you.
0
 
Dane PickeringAuthor Commented:
the last line sys

testuser:password:100:101::/home/testuser:/bin/bash

thats all...
0
 
Dane PickeringAuthor Commented:
Adjusted points to 75
0
 
ahoffmannCommented:
Oh my dear, what's the problem telling us the result of following commands?

    cd /home/testuser
    su - testuser
0
 
Dane PickeringAuthor Commented:
su works fine... logged in without any problems..

and su works for nigel ss well..


though this still doesn't fix the initial problem I still can't log in as the user..

-- Dane
0
 
ahoffmannCommented:
if   su - testuser   works, then you have a valid account.
Problem could be password.
Do you have /etc/shadow? If so ther must also be a line for testuser. If this is also ok, try as root:

   passwd testuser

(answer the questions) , then try again.
0
 
Dane PickeringAuthor Commented:
Ok, kewl, again i will have to wait till i get home this afternoon, but something that i can remember that may make a difference is that when i logged in as testuser with su it didn't ask for a password, and before you ask i did try and log in without any password..
0
 
nigesCommented:
I also think the problem lies with in the password....
0
 
nigesCommented:
Am update on the problem. It does lie within the password. I added a user in the X-win usercfg and set it to no password. Then I logged off and triued to login with the user with no password. I was able to. I also looked in the passwd file, every login has an X for the password where the password doesn't exist eg accounts like ftp, adm, daemon etc. The root account has an encrypted password there and the account we add has the password in plain view without encryption, I guess something to do with shadow passwords???

--Nige

ps we can su newuser as it skips the password, but as soon as we need a password, we can't login????
0
 
ahoffmannCommented:
Try & error is an other method for solving problems, probably you'll have success, sometimes .. ;-))
Good luck.
0
 
nigesCommented:
Umm, we have tried about 2000000000 times, with every parameter and every option on and off, but no avail....

We really need help...

--Nige
0
 
nigesCommented:
I  am also willing to post a question worth 75 points that whoever answers this question can answer and I will award them the points aswell. That makes a total of 150 points * an A grade...

--Nige
0
 
ahoffmannCommented:
Just increasing points won't help much.
Please answer my question from june 02, and be very picky when reading them again !
0
 
Dane PickeringAuthor Commented:
ok, tried that and changing the password works..


this hasn't fixed the problem,  this has got a work around.

so the problem is with the password somewhere so now we have ot find out where!!

-- Dane
0
 
marcelofrCommented:
Just my 2 cents:

-p option to useradd is for an encrytpted password and

if you have shadow, your crypted password should go to /etc/shadow. But there's a well known bug in pam and when root changes the passwd to OTHER user, it gets changed into /etc/passwd, making some thing work but breaking others... Just add the keyword shadow at the end of the last line in /etc/pam.d/passwd, if not there.

Good luck

-- Marcelo
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.