Changing user name

Doncho N. Gunchev mr700 at
Sat Dec 18 16:11:15 UTC 2004

On 2004-12-17 (Friday) 16:40, Jeff Kinz wrote:
> On Fri, Dec 17, 2004 at 03:17:22PM +0100, Beppe wrote:
> > Maciek R. wrote:
> > >how do I change my current user name on Linux? I there a way to rename
> > >it (with all folders and the whole stuf)?
> > >
> > As superuser:
> > - rename your home/old_user to home/new_user
> > - create new_user without creating home dir
> > - # chown -r new_user:new_user home/new_user
> This approach will work, but...
> a drawback to this approach is that it destroys the continuity of the
> user id and group id of any of this user's files which are stored
> anywhere except the user's home directory.  For example, backups, or
> even floppies or some flash media devices where Linux compatible
> file systems have been created.
> If this happens, the user would no longer own or be able to read their
> own files.
> To prevent that problem, it might be a better ides to have the user keep
> their original user ID and group ID but change the user's name in the
> passwd and group files using the 
> vipw 
> command and the 
> "vi /etc/group command"

  vigr in this case

> Both the first method and this second one have a drawback when reading tar
> files.  In a tar file the file owner's name is stored as a string, which
> will no longer match the owner's user name in both cases, but this is
> easily worked around.

    You have to rename /var/spool/mail/<user> file, crontab and at jobs too.

  Doncho N. Gunchev    Registered Linux User #291323 at
  GPG-Key-ID: 1024D/DA454F79              
  Key fingerprint = 684F 688B C508 C609 0371  5E0F A089 CB15 DA45 4F79

More information about the users mailing list