Unix and long usernames
I ran into an odd issue the other day when I was working on a Linux box. I noticed a number of processes in the ps output were listed with the user's UID instead of his username. It took a little poking around before I realized that it was usernames with more than eight characters that were replaced by the numeric IDs. While this wasn't a big problem, it makes it a lot more trouble to figure out who is running what processes if I have to look them up in the /etc/passwd file.
I could truncate usernames to eight characters and be done with it. Then again, I'd have to inform all the users with nine or more characters that I had shortened their usernames and they would probably stress out at having to remember another variation of their login name. Besides, it seems this old limitation of Unix systems could be handled more smoothly. Even if there would be some workaround to make ps output look the way I expected, would I want to teach it to everyone or force their accounts to alias the command to ps?
The simplest way around the issue seemed to be to create a second entry in the /etc/passwd file. Where I once had:
slrauenzahn:x:111:111:Sara L. Rauenzahn:/home/slrauenzahn:/bin/bash
I now have this:
slrauenz:x:111:111:Sara L. Rauenzahn:/home/slrauenzahn:/bin/bash
slrauenzahn:x:111:111:Sara L. Rauenzahn:/home/slrauenzahn:/bin/bash
Sara can still log in with her usual "slrauenzahn" username, but when I and others examine processes with "ps -ef", we will see "slrauenz" alongside each of her processes and will recognize the processes as hers. I could have as easily called the added username "sara" or "sarar" if I thought it would make her easier to recognize. The processes that fetch the username from the /etc/passwd file will simply grab the first entry that matches the UID. In this case, that's 111.
Unix and eight character usernames go back a long way, even further back than eight character filenames in DOS. What surprises me is that longer usernames can still present problems. With 2 TB files and pathnames that exceed 4000 characters, why are Unix systems today still plagued by problems when usernames exceed eight little characters?
The other "eight character" problem I run into from time to time involves a user trying to change his password. I'll get a call from one of my users telling me that he can't change his password. He tells me the system comes back with "Permission denied". Almost every time, the user has a username that exceeds eight characters and I have to suggest that they enter their username after passwd command so that Unix will not be confused.
boson> passwd
passwd: Changing password for slrauenz
passwd: User unknown: slrauenz
Permission denied
boson> passwd slrauenzahn
Enter existing login password:
Unix systems have developed in magnificent ways. With outstanding file systems (like zfs!), impressive degrees of virtualization, zones and much improved systems administration tools, Unix has grown into an ever increasingly impressive operating system. There are just these odd little problems that still seem to plague even the best implementations of my very favorite OS. Sigh!
Sign up for ITworld's Daily newsletter
Follow ITworld on Twitter @IT_world
Brian Proffitt
Microsoft/Novell: Breaking Down the Coupon Numbers
Esther Schindler
Drupal's Dries Buytaert on Building the Next Drupal
Tom Henderson
Top Ten General Operating Systems Rants
pasmith
PS3 motion controller delayed; goes up against Project Natal
sjvn
Neolithic Windows security hole alive and well in Windows 7
claird
Perl source code comparison makes for good reading
James Gaskin
Learn How To Print Pages In Order with Ink Jet Printers
mikelgan
Cell phones don't create stress or interrupt much
Sandra Henry-Stocker
How to: The Unix Interview
Where Google Chrome security fails: the password
I heard mention that the Chrome OS will have some sort of encryption available a la bitlocker. If it's possible to encrypt personal data using another password or key, then it may have potential for very secure data.... And Ubuntu has an 'encrypt home directory' option, perhaps google should follow suit.
- Dann
Join the conversation here
Quick, practical advice for IT pros. Made fresh daily.
- Ubuntu advances: Why Ubuntu server installations will surge in 2010
- Social media marketing: How to make friends with benefits
- More...
Want to cash in on your IT savvy? Send your tip to tips@itworld.com. If we post it, we'll send you a $25 Amazon e-gift card.







What happens with Shadow
What happens with Shadow file for the first entry, after we run pwconv next time?And another thing: file
And another thing: file pathsI had a file which I had tar'd and gzip'd on a Ubuntu machine which I needed to untar on a Solaris 9 server. Easy enough, done it loads of times. Except this time I got directory checksum error! Some of the paths exceeded 100 characters.
Removing the (relative) root directory brought the paths back under the limit but it is still a real pain in the neck, as now creating the anchoring directory is a manual step in my deployment process. Perhaps there is a neater way around it but my Google-Fu wasn't up to finding it.
Cheers, APC
Microsoft Exams: 70-270,
Microsoft Exams: 70-270, 70-652, 70-630, 70-431, 70-642Cisco Exams: 642-426, 642-524, 642-164
IBM Exams: 000-015, 000-331, 000-210
CompTIA Exams: sy0-101, 220-601
VMware Exam: vcp-310
EMC Exam: e20-001