Originally posted by trevelluk
All of the users are listed in the /etc/passwd file (you may need to be root to read it). It's also got a whole load of other information as well as the user names. To just get the user names, try something like:
cat /etc/passwd | cut -d":" -f1
All users on the system should be able to read /etc/passwd as far as I know, or else they can't log in to the system.