you can use this command to print all keys in a NIS database

# ypcat passwd

the ypcat command lets you display the values of all the keys in a NIS databse. to display the user's information from /etc/passwd file in a server, then you have to use ypcat passwd.

note: if you dont have a NIS databse, then you will get this error:

ypcat: can't get local yp domain: Local domain name not set