passwd: Cannot determine your user name


Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: passwd: Cannot determine your user name

  1. #1
    Join Date
    Jun 2003
    Location
    uk
    Posts
    20

    Question passwd: Cannot determine your user name

    Hi

    I've just got my hands on linux4geeks and, not being very geeky, I'm pleased to have got it going up to the login promt! Unfortunately that's where it ends.

    Chrooting in to my l4g partition and running passwd returns:
    ________passwd: Cannot determine your user name.

    Whoami returns:
    ________whoami: cannot find username for UID 0

    When booting into l4g, failing to login and ctrl+alt+deleting out, the systems hangs with:
    sulogin cannot open password database

    l4g is in pre-alpha so I have had to sort out some sym links for various library files but from what I can gather the libraries required by login, passwd etc are there. I am just a bit stumped as to where exactly the failure is occuring.

    I've looked at the LFS book (on which l4g is based) and the normal texts and have done an extensive web search but I'm only finding stuff about how to use user/passwd stuff if it's working. The only exception to this seems to be suggestions (on LFS forums) that glibc (if I'm rembering right) wasn't installed correctly but that seems to go with the bash promt displaying "I have no name", which it doesn't.

    I've tried creating new users and have fiddled (deleted passwords, makeing new files, adding entires) around with /etc/passwd,group,shadow but just get the same errors.

    Any help/ideas would be really appreciated. l4g may be for geeks but it is also a simple enough setup for me to get my head around so that I can *learn*!

    slippery
    Last edited by slipperyfish; 08-23-2003 at 12:35 PM.

  2. #2
    Join Date
    May 2003
    Posts
    184
    Weird. Apparently it recongizes your UID is 0 but can't find a username for it . I'm pretty much a newbie, but what do the commands "id", "id -u" and "id -nu" return you?

    EDIT: you can't login when you boot l4g right? If I'm not mistaken you can just remove the "x" right after the username in /etc/passwd, and then use no password. Not sure that works though.... Oh yeah, you have tried "passwd root" right?

    Good luck fellow,
    Fernando Azambuja
    Last edited by azambuja; 08-23-2003 at 01:04 PM.

  3. #3
    Join Date
    Jun 2003
    Location
    uk
    Posts
    20
    id returns: uid=0 gid=0 groups=0
    id -u returns: 0
    id -nu returns: 0

    I tried removing the x in /etc/passwd and also the password in /etc/shadow. That is, both of them together and individually... hmmmmm??? it's got me a bit stumped...

  4. #4
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936

    Re: passwd: Cannot determine your user name

    Originally posted by slipperyfish
    sulogin cannot open password database
    Try to touch /etc/passwd, then use useradd along with groupadd to create some users.

    Before you create the users, though, you might want to edit /etc/passwd manually and add an entry for root. Should look something like:

    root::0:0::/root:/bin/bash
    Once you have that there, you should be able to run passwd and set up a password for root. And once root has a password, create some other users and you should be able to log in as them.

  5. #5
    Join Date
    Jun 2003
    Location
    uk
    Posts
    20
    No, I've tried that. login, password etc don't seem *able* to find /etc/passwd, as opposed to not liking what they read if they could.

  6. #6
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    Oh, I didn't see your comment at the end of your last post...

    Hmm...

    What are the contents of the "passwd", "group", and "shadow" lines in your /etc/nsswitch.conf file? If you have one...

  7. #7
    Join Date
    Jun 2003
    Location
    uk
    Posts
    20
    Originally posted by bwkaz
    What are the contents of the "passwd", "group", and "shadow" lines in your /etc/nsswitch.conf file? If you have one...
    passwd: files
    group: files
    shadow: files

    I'm guessing that's ok... ...

  8. #8
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    Yeah, that's fine... rats.

    I don't suppose there's anything relevant in the l4g docs, is there?

    If you've shadowed your passwords (if you've run /sbin/pwconv), then make sure you're using the login, su, etc. programs from the shadow package, not the ones from either util-linux or sh-utils or whatever other package provides them... but I wouldn't think something like that would cause this...

  9. #9
    Join Date
    Oct 2000
    Location
    Calgary, Alberta, Canada
    Posts
    8,116

  10. #10
    Join Date
    Jun 2003
    Location
    uk
    Posts
    20
    Originally posted by Hayl
    what are the results of:

    echo $PATH

    ?
    localhost:/ # echo $PATH
    /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/games

    Just for the record I enter the system (as instructed in LFS book on which l4g is based) with:
    [root@localhost m]# chroot /mnt/l4g/ /usr/bin/env -i HOME=/root TERM=$TERM PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login

    This gives me a bash prompt:
    localhost:/ #

    If I just chroot /mnt/l4g I get:
    bash-2.05b#

    This is in a konsole shell. However I just thought I'd login in tty1 (using both chroot options above) and I got prompt:
    [I have no name!@localhost]#
    This worries me because I read in the LFS book that this is the case before glibc has been installed. Obviously glibc has been installed on l4g but I wonder if there is something wrong relating to that (I'm off to investigate that now). As said in top thread I also saw a forum post about this, it talked about reinstalling everything.

    hmmm

  11. #11
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    What do you get if you run ldd /bin/bash? Can it find libc.so?

  12. #12
    Join Date
    Jun 2003
    Location
    uk
    Posts
    20
    Originally posted by bwkaz
    What do you get if you run ldd /bin/bash? Can it find libc.so?
    Yes, but it didn't used to... When I first copied the files to the partition and tried to chroot in I couldn't because bash couldn't find libc.so.6 (amongst others). There have been a whole load of library files that I have had to sym link to a name that things are looking for (ie. ln -s librt-2.2.5.so librt.so.1). I've got tar, make, gawk and others going this way. Obviosly I've been looking at my host system (mdk9.1) just to see that they have done similar.

    I do wonder though if one of those links is pointing to something that seems to be ok but isn't (ie. the binary executes but not properly). login required:

    ln -s libmisc.so.0.0.0 libmisc.so.0
    ln -s libshadow.so.0.0.0 libshadow.so.0
    ln -s libcrypt-2.2.5.so libcrypt.so.1

    The crypt and shadow in that list makes me think...

    Thanks bwkaz for your thoughts so far. I may not have the 'answer' but it's helping my thinking having a different point of view

    I'm going off to investigate library versions compatibility (or something!) now...

  13. #13
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    Is /lib/libnss_files-2.2.5.so readable and executable?

    While I'm at it, what about the rest of the /lib/libnss* libraries?

  14. #14
    Join Date
    Jun 2003
    Location
    uk
    Posts
    20
    libnss_files-2.2.5.so was fine... unfortunately though libnss_files.so.2 was what was wanted.

    A simple "ln -s libnss_files-2.2.5.so libnss_files.so.2" later and whoami?

    root

    Thank you very very much xxx

    I'm now wondering why I didn't think of "ldd * | grep 'not found' -B3" a little sooner.

    still can't boot into the system though... but I think that may be a topic for another thread.
    and so it goes on.
    thanks

  15. #15
    Join Date
    Jun 2003
    Location
    uk
    Posts
    20
    Maybe not a new post quite yet.

    Now I'm over the euphoria of being able to change my password I'm wondering why logging in from a boot up doesn't work.

    I fixed the fact that the init.d scripts weren't being found. I converted my password (after trying to boot first without) and I've had a good long think about how just changing root differs from booting... but so far I'm stuck.

    I just wonder if this is an extension of the same problem or a completely new one. hmmmm.

    any thoughts gratefully received.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •