UPDATED: Long user names in AIX
AnthonyEnglish 270000RKFN Comments (2) Visits (22279)
User names on AIX used to be restricted to eight characters. That's still the default setting but since AIX 5.3 you can increase the length up to an amazing 256 characters, if users really want to spend the morning logging in.
You can view the current maximum login name using:
lsattr –El sys0 | grep max_logname
Update: I incorrectly had listed the parameter as max_login. The correct parameter is max_logname. Thanks to jabber44 for the correction.
or via smit
System Environments -> Change / Show Characteristics of Operating System
then arrow down to the next page to see:
Maximum login name length at boot time  +#
You can change this setting here, or using the chdev command on the command line:
chdev -l sys0 -a max_logname=N
(Corrected here as well).
Whichever way you change it, it will only take effect from next time you reboot the OS.
The long and the short of user names
Why would you do this? Primarily to have user names consistent with network logins, such as when you use Kerberos to authenticate against Active Directory.
When you list files using the command ls -l, by default you only see the first eight characters of the owner's user name.
-rw------- 1 a_long_u system 0 May 13 09:53 file1
This can be misleading.
If you try to change ownership of a file via chown using that truncated name, you'll get a message that the user doesn't exist. So the ls command needs to be able to display the full name, which you can do using the -X flag:
-rw------- 1 a_long_username system 0 May 13 09:53 file1
There are other commands which require special options to display user names longer than 8 characters, such as
find (use -long)
tar which uses -E (-X is already used for something else)
who (-X again, just like the ls command)
Extravagance and inelegance
A couple of warnings. If you decide to revert to short names again, you may lock out users who had more extravagant login names before the reboot. It would not be an easy task to identify all the files which were owned by users with long names.
The other point to note is that long lists of files may result in the jagged-edge effect, which is exactly the reason those of us with a sense of symmetry keep logical volume names under 9 characters. If that's not reason enough, it can also make it hard to use that selection of a rectangle in Putty which I mentioned at the end of my blog entry on how to list file systems in a volume group.