If you ever get this error it seems your /etc/passwd file doesn't have read permission for "others" section.
chmod o+r /etc /etc/passwd
Expected result:
-rw-r--r-- 1 root root 2123 Jun 22 01:11 /etc/passwd
Referral Note: When you purchase through a referral link (if any) on this page, we may earn a commission.
If you're feeling thankful, you can buy me a coffee or a beer
I have no name!@ip-172-42-10-132:~$ chmod o+r /etc /etc/passwd
chmod: changing permissions of ‘/etc’: Operation not permitted
chmod: cannot access ‘/etc/passwd’: Permission denied
are you running the command with 'root' ?