Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

RH 5.0 and adduser

Posted on 1998-05-30
24
Medium Priority
?
404 Views
Last Modified: 2013-12-15
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
0
Comment
Question by:Dane Pickering
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
  • 7
  • +2
24 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1627397
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
 
LVL 1

Expert Comment

by:niges
ID: 1627398
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
 
LVL 1

Expert Comment

by:niges
ID: 1627399
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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 2

Author Comment

by:Dane Pickering
ID: 1627400
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1627401
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
 
LVL 2

Author Comment

by:Dane Pickering
ID: 1627402
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
 
LVL 1

Expert Comment

by:niges
ID: 1627403
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
 
LVL 1

Expert Comment

by:niges
ID: 1627404
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1627405
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
 
LVL 2

Author Comment

by:Dane Pickering
ID: 1627406
the last line sys

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

thats all...
0
 
LVL 2

Author Comment

by:Dane Pickering
ID: 1627407
Adjusted points to 75
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1627408
Oh my dear, what's the problem telling us the result of following commands?

    cd /home/testuser
    su - testuser
0
 
LVL 2

Author Comment

by:Dane Pickering
ID: 1627409
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1627410
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
 
LVL 2

Author Comment

by:Dane Pickering
ID: 1627411
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
 
LVL 1

Expert Comment

by:niges
ID: 1627412
I also think the problem lies with in the password....
0
 
LVL 1

Expert Comment

by:niges
ID: 1627413
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1627414
Try & error is an other method for solving problems, probably you'll have success, sometimes .. ;-))
Good luck.
0
 
LVL 1

Expert Comment

by:niges
ID: 1627415
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
 
LVL 1

Expert Comment

by:niges
ID: 1627416
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1627417
Just increasing points won't help much.
Please answer my question from june 02, and be very picky when reading them again !
0
 
LVL 2

Author Comment

by:Dane Pickering
ID: 1627418
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
 
LVL 3

Expert Comment

by:marcelofr
ID: 1627419
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
 

Accepted Solution

by:
sortof earned 140 total points
ID: 1627420
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

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question