A few pitfalls:
Some distros create a group with the same name as the user, so user john gets the group john.
'usermod -l john_smith john' will change the username from john to john_smith, but not his group. he will be john_smith in group john.
use 'groupmod -n john_smith john' to change the groupname accordingly to get the group changed. Again, IF your distro does such.
indeed, the home directory...
using 'usermod -l john_smith john' does change the username, but not his home directory!..
use 'usermod -l john_smith -d /home/john_smith john' instead, to make the homedir change as well..
Don't forget to rename his homedirectory with 'mv /home/john /home/john_smith'.
Finally: the mail spool file.. I don't know if distros fix that automagically. User john has his own mail spool file, in most cases '/var/spool/mail/john'. You'll have to rename the file to fit the new username with 'mv /var/spool/mail/john /var/spool/mail/john_smith'.
Oh, I based the given commands on my distro, Fedora. I can't tell how your version would react. Mostly they're alike, just to be sure: 'man usermod', 'man groupmod' to verify correctness.
This would fix a lot.
PS using samba? don't forget to change the user over there as well.
Last edited by rhoekstra; 12-23-2004 at 02:13 AM.