I'm asking for the type of characters supported by user passwords (the passwd
command precisely)
Are spaces allowed? NULL characters (\0)? a subset of ASCII or more?
If spaces are allowed do I need to escape them?
command linepassword
I'm asking for the type of characters supported by user passwords (the passwd
command precisely)
Are spaces allowed? NULL characters (\0)? a subset of ASCII or more?
If spaces are allowed do I need to escape them?
Best Answer
Based on testing:
\0
is treated as marking the end of the password.From my reading of the source, the
passwd
command uses the (obsolete)getpass
function, which behaves pretty much likeread -s
(and marks the end of the password string with\0
). It does not restrict the characters usable, aside from some checking of reuse and complexity.\0
cannot be used, since it gets treated as the normal end-of-string marker in C strings, but pretty much anything else can, such as the bell: