User Account: change name

Paul M. Bucalo ubuntuser at pmbservices.com
Thu May 26 17:36:28 UTC 2005


On Thu, 2005-05-26 at 19:05 +0200, René L. Reingard wrote:
> Am Thu, 26 May 2005 17:31:29 +0200 schrieb Dennis Kaarsemaker  
> <dennis at kaarsemaker.net>:
> 
> > On do, 2005-05-26 at 17:15 +0200, René L. Reingard wrote:
> >
> >> how can i change a users name?
> >
> > You can either manually edit /etc/passwd, /etc/shadow and /etc/group or
> > create a new user and simply make the old homedir the homedir of the new
> > user (you can rename it of course). In both cases make sure the user is
> > not logged in. If the username is listed  in the sudoers file (or any
> > other administrative file), you will need to change that too.
> 
> hmm, i did create a new user and made the home of the old user the home of  
> the new user.
> result: no login possible
> error: ~/.xsession-errors / libgnomevfs-WARNING / unable to create  
> ~/.gnome2 directory: No Authority
> 
> what to say on that?

Two problems that I can see. The name of each 'home directory' should be
the same as the name of the user that possesses it. You can alter this
or break convention, but for where you are at right now, it would be
much easier on you and the system to just rename the directory to the
'new user's' name. Secondly, the directory is still under ownership
(user name and group) of the 'old user'. You need to change these to
reflect the 'new user':

sudo chown -R <new_user_name>.<new_user_group> /home/<old_user_name>/*

then do:

sudo chown -R <new_user_name>.<new_user_group> /home/<old_user_name>/.*

Make sure to be logged in as some other user than the ones involved in
the switch when doing this, and use 'sudo' (or an 'su -' login, if you
have aloud for a root account) to gain proper permission to make these
changes.

HTH,

Paul





More information about the ubuntu-users mailing list