I have non-sudo ssh access to a server of which I want to know the list of users, I think the server is using ldap because:
-bash-4.2$ cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: files ldap
group: files ldap
shadow: files ldap
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
but:
-bash-4.2$ cd /etc/sssd/
-bash: cd: /etc/sssd/: No such file or directory
Please note neither of /etc/passwd
, ls -lsa /var
or getent passwd
is giving the list I want (they don't even include my own username)
So, does anyone have any idea on how I can get the list of usernames and ids of this server?
-bash-4.2$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.11 (wheezy)
Release: 7.11
Codename: wheezy
getent passwd {0..65535}
work for you? See also How can I list all user names and/or home directories? – Stéphane Chazelas Dec 15 '17 at 11:08wbinfo -u
– Archemar Dec 18 '17 at 11:54getent passwd
doesn't show your own user, trygetent passwd $(whoami)
. If that works, then your LDAP is not being enumerated (a very unfriendly configuration). You might be able to fix that in, e.g./etc/sssd/sssd.conf
by settingenumerate = true
– jrw32982 Mar 06 '19 at 19:34