Which code set is /etc/passwd stored in? Can it be UTF-8? What limits are placed on user names? Which code set is /etc/passwd stored in? Can it be UTF-8? What limits are placed on user names? unix unix

Which code set is /etc/passwd stored in? Can it be UTF-8? What limits are placed on user names?


It's all ASCII. But the password itself is never stored - only the results of the one-way hash. If you're wondering what characters can be in the password itself, it depends on the locale, which will restrict the characters your terminal is able to deal with. See "man locale"

From the BSD man page:

"/etc/passwd ASCII password file..."

As for usernames, I can tell you that Solaris only supports ASCII. I can't speak for other Unix-en.

"Not every object in Solaris 2 and Solaris 7can have names composed of arbitrary characters. The names of the following objects must be composed of ASCII characters:

* User names, group name, and passwords* System name ...

"