ls shows only userid and groupid instead of username and group name


I'm trying to make a rescue linux filesystem that will be booted via NFS trough a PXE enabled NIC.

I can boot right now, the kernel loads perfectly and remote file system is mounted, however, I have constructed the file system in a command by command basis, I mean, when I get an error, I copy the missing file or library to the new fs.

I now, can run commands like cat,more etc, however the ls command reports userid and group id instead of username and groupname /etc/passwd and /etc/group are there and readable.

What file do you think can be missing in my new filesystem?

Who is Participating?
wesly_chenConnect With a Mentor Commented:

   You mean you don't have /etc/nsswitch.conf file before?
   By default, the file should be installed. However, it might be corrupted or be deleted by accident.

   Anyway, glad to hear your problem resolved.

>  ls command reports userid and group id instead of username and groupname /etc/passwd and /etc/group
Are those UID and GID in your local /etc/passwd or /etc/group since you mention about NFS?
If not, then you need to add into /etc/passwd on the machine where you run "ls".

egarciatAuthor Commented:
Thanks Wesly, of course they are.
egarciatAuthor Commented:
I found the solution, I'll post it here in case some one else has the same problem.

There was a file left.  /etc/nsswitch.conf

This file defines locations for some files including passwd and group if this file is missing the lib wont be able to find these files.

All Courses

From novice to tech pro — start learning today.