Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When installing Ubuntu, we're restricted to lower-case usernames. But recently I registered for a shell based on Ubuntu and logging in is done by the username registered to sign in to that site. The username starts with upper-case letter, and when logging using SSH, I need the letter in uppercase to log in - it refuses me if I use lowercase.

What's the deal? I want to use uppercase letters on the account of my regular install if possible.

share|improve this question
add comment

1 Answer

up vote 9 down vote accepted

The reason why isn't clear - though it appears that some programs don't distinguish between CAPITAL and lowercase usernames. As such there lies a potential for conflict if you have a Marco and a marco account.

There currently doesn't appear to be any way to have this done via the users-admin or Ubiquity - likely that these rules are hard-coded instead of pulled from the adduser.conf file.

You add the user via the command-line if you force a "bad username":

root@mine:~# adduser --force-badname Marco
Allowing use of questionable username.
Adding user `Marco' ...
Adding new group `Marco' (1002) ...
Adding new user `Marco' (1002) with group `Marco' ...
Creating home directory `/home/Marco' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for Marco
Enter the new value, or press ENTER for the default
        Full Name []: Marco Ceppi
        Room Number []: 
        Work Phone []: 
        Home Phone []: 
        Other []: 
Is the information correct? [Y/n] y

If you want to add users without needing to --force-badname you can change this line in /etc/adduser.conf:

#NAME_REGEX="^[a-z][-a-z0-9_]*\$"

To this

NAME_REGEX="^[a-zA-Z][-a-zA-Z0-9_]*\$"

This will allow Uppercase names for users. While there is no way to add users to additional groups via the adduser command you can use the usermod command instead:

usermod -G admin Marco
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.