Questions tagged [getent]

24 questions
15
votes
1 answer

getent hosts prints IPv6, getent ahosts prints IPv4

Verbatim output from my terminal: $ getent hosts example.org 2001:500:88:200::10 example.org $ getent ahosts example.org 192.0.43.10 STREAM 43-10.any.icann.org 192.0.43.10 DGRAM 192.0.43.10 RAW I thought they were both (at the…
l0b0
  • 50,672
  • 41
  • 197
  • 360
8
votes
2 answers

read files directly VS getent

In various shell scripts I often see two approaches for getting information from databases supported by Name Service Switch libraries like /etc/group, /etc/hosts or /etc/services. One is getent utility and other is grep or some other text processing…
Martin
  • 7,284
  • 40
  • 125
  • 208
5
votes
1 answer

getent passwd -s sss LOCALUSER shows local user

tl;dr I want to easily and quickly tell if a user is local or domain (don't care which domain). Environment freeipa-client-4.6.1-3.fc27.x86_64 sssd-1.16.0-4.fc27.x86_64 Full story I am writing a userinfo.sh script that will show if a user is…
bgStack15
  • 381
  • 2
  • 11
5
votes
0 answers

getent shadow shows password hashes for some users

If I execute sudo getent shadow I see password hashes for all the local users who have them. For most of the LDAP accounts I only see * in the password field. However, for a few LDAP users, I see password hashes. I have verified that they don't…
Dennis Williamson
  • 6,620
  • 1
  • 34
  • 38
4
votes
1 answer

Groups from LDAP: "getent" reports membership correctly but missing in output of "id"

I have a Debian 10 machine which uses PAM LDAP for authentication. In LDAP I have two users alice and bob which are both members of group mygroup. Everything has worked fine (so the configuration shouldn't be too far off) until I recently discovered…
Martin Konrad
  • 2,090
  • 2
  • 16
  • 32
4
votes
1 answer

Inconsistency between “getent group” and “getent group ” – why?

Question How is the following possible? $ getent group | grep docker $ getent group docker docker:x:600: Note that the first call doesn’t return anything while the second one does. grpck doesn’t report any issues. Some Background This is on a…
Chriki
  • 205
  • 2
  • 11
3
votes
2 answers

Why does getent default to .station if no TLD is specified?

With my current setup, I have a dnsmasq instance operating on my home server (Void Linux) and 3 GNU/Linux devices that use it as default dns (1 Manjaro, 1 Arch, 1 Linux Mint 20.1). Due to seemingly unrelated issues, I was testing the mdns name…
Mek101
  • 43
  • 4
3
votes
0 answers

getent hosts not using DNS

I'm using Ubuntu workstation (14.04), using OpenLDAP for authentication. The /etc/nsswitch.conf files on these look like this so that to get a host it should try files, then LDAP and then go on to check DNS: passwd: files ldap group: …
TerryS
  • 31
  • 1
3
votes
1 answer

command to get username via id

There is a command id to get the user id. E.g. id -u rootgives me 0. Is there an opposite command to get the user name via the id? I know I can grep /etc/passwdor run getent and awk or cutthe result. My question is if there is a dedicated command or…
2
votes
1 answer

User listed in group but not in getent passwd

On a specific machine with both local users and LDAP users, there is a user that is listed under getent group foo (let's say the user jdoe is listed), but when doing getent passwd jdoe I get no output. Attempting sudo su jdoe doesn't work…
Joeytje50
  • 165
  • 6
2
votes
1 answer

What must be added to nsswitch.conf to show AD users and groups?

This is a follow-up to this question. I have a CentOS 7 machine which has joined a domain FOOBAR. It is possible to successfully get info about users stored in the AD via id [email protected] However, getent passwd and getent group do not show…
dr_
  • 28,763
  • 21
  • 89
  • 133
1
vote
1 answer

'getent passwd' not showing LDAP users, athough users can log in

I have an administration node running LDAP and a login node which uses LDAP on the other node to authorize users. Users are able to log into the login node successfully. When I run getent passwd, on the admin node I get all the users, both those…
loris
  • 195
  • 1
  • 11
1
vote
1 answer

How to get list of users with a given group as primary group

With getent group xyz I get a list of users who are members of xyz with xyz either as a primary group or as secondary group. How do I get a list of just those users who have xyz as their primary group? My users are in LDAP, so I am not looking for…
loris
  • 195
  • 1
  • 11
1
vote
1 answer

Random DNS errors after change to nsswitch.conf

I recently installed my EPSON L3150 printer's drivers and about the same time I started having weird (and random) DNS name resolution errors in some applications (ssh, nextcloud-client), that I can only fix by restarting the NetworkManager…
arielnmz
  • 519
  • 1
  • 6
  • 23
1
vote
0 answers

List of Users - RHEL

I want to get list of users - both human and machine who have access to the unix server. OS is: NAME="Red Hat Enterprise Linux Server" VERSION="7.9 (Maipo)" I tried cat /etc/passwd and getent passwd - but both these lists are incomplete. A number…
1
2