3

I am looking for a list of the valid characters which can be used in a user account password on Ubuntu. man passwd just tells me:

As a general guideline, passwords should consist of 6 to 8 characters including one or more characters from each of the following sets:

  • lower case alphabetics
  • digits 0 thru 9
  • punctuation marks

Which is not helping much.

muru
  • 193,181
  • 53
  • 473
  • 722
wim
  • 12,548
  • 27
  • 73
  • 101
  • - There have to be some unspoken limits. Tried the same password 5 times and it still didn't work. I reinstalled Ubuntu each time. My full response can be found here: https://askubuntu.com/questions/176337/installed-perfectly-but-password-not-working-for-login-or-authentication/1429239#1429239 – Nicholas Reynolds Sep 19 '22 at 15:39

3 Answers3

2

Passwords allows the following:

  • Lowercase Alphabetical (a, b, c, etc.)
  • Uppercase Alphabetical (A, B, C, etc.)
  • Numerics (0, 1, 2, etc.)
  • Special Characters (@, %, !, etc.)

for more details have a look https://help.ubuntu.com/community/StrongPasswords

Braiam
  • 66,947
  • 30
  • 177
  • 264
One Zero
  • 26,773
  • 26
  • 87
  • 109
1

User account passwords haven't been stored in Linux since a long time. Instead only password hashes are stored and the hash primitives can all operate on arbitrary (byte) strings. This means that the only limitation on characters in password is the character set of the character encoding used during password entry. By default Ubuntu uses UTF-8, which can encode a superset of all common character sets.

However, you can't enter arbitrary characters (easily) on a common keyboard and you may be restricted to use a different keyboard layout to authenticate with a password than when the password was created.

David Foerster
  • 35,754
  • 55
  • 92
  • 145
  • Note that passwords have never been stored as is anywhere, including the `/etc/passwd` file. We only had hashes (way back it was using crypt() which is now considered insecure, but still it was a hash.) Now, though, we save the passwords in a separate file: `/etc/shadow`, which most people do not have access to. – Alexis Wilke Sep 23 '18 at 05:47
  • @AlexisWilke: Right. That practice started before Linux came into existence. Older Unices did store plain-text passwords though. – David Foerster Sep 23 '18 at 08:06
0

I suspect some characters are not allowed. I created a password with upper, lower case characters, numbers, and special characters. Wrote it down, tried to login and failed repeatedly. Went to recovery mode, reverted to a simple password and logged in again. I changed the password back to the above complicated one and could not login again. I do not know which of these characters offends the system, but here are the special characters i used. One of them is a problem. # ; . @ [

david
  • 9
  • 1
  • 3
    This answer could be improved by making it more specific by testing to find out which special character was not allowed. Some of the special characters in your answer are allowed to be used in passwords. – karel Jan 17 '17 at 05:28