So I know this is probably a pretty elementary task and I should know how to do this, and I kind of do, I'm just seeking some reasurance so I don't wipe my $HOME.

Basically, as some of you will notice I've recently changed my username, so naturally I want to change my username on my machine also.

I have so far created another user pfr and added it to groups: users, operator & wheel, set a login password and have it's $HOME set to /home/pfr

What I need to do without fucking up is move my /home/dave (which is obviously my current $HOME for my current user dave) including all of its contents, over to /home/pfr

As I understand it the correct command is:
# usermod -m -d /home/pfr dave
But I'm nervous and wanted to just ask people who are smarter than me.

I've also read a little about using vipw(8) but I'm not sure about that either. If there is an easier way please shout out.

Cheers

  • oui replied to this.
    • Best Answerset by pfr

    oui Also curious to know why the username change to pfr?

    Well, I finally realised that a shorter username is more sensible and saves time typing and also saves space on my screen!
    pfr isn't anything imaginative, my surname is Pfeiffer so I just picked the letters from there.

    🙂

    EDIT: succesfully moved home dir with # usermod -d /home/pfr -d pfr
    Rather than creating a new user (I deleted the user pfr that I had created earlier). I just remamed my user with # usermod -l pfr dave and then the above command to move home dir. I then needed to update /etc/group which I tried groupmod but this didn't work so I just edited it manually.

    pfr As I understand it the correct command is:
    # usermod -m -d /home/pfr dave

    There's a couple of different ways to do this, the command above is all good (no need to be nervous) but this could be a good opportunity to backup your home folder just in case your machine catches fire.

    Also curious to know why the username change to pfr? 😁

      oui Also curious to know why the username change to pfr? 😁

      Staying behind a packet filter is always a good idea. Why shouldn't this apply to usernames too?

      • oui likes this.
      • Edited
      • Best Answerset by pfr

      oui Also curious to know why the username change to pfr?

      Well, I finally realised that a shorter username is more sensible and saves time typing and also saves space on my screen!
      pfr isn't anything imaginative, my surname is Pfeiffer so I just picked the letters from there.

      🙂

      EDIT: succesfully moved home dir with # usermod -d /home/pfr -d pfr
      Rather than creating a new user (I deleted the user pfr that I had created earlier). I just remamed my user with # usermod -l pfr dave and then the above command to move home dir. I then needed to update /etc/group which I tried groupmod but this didn't work so I just edited it manually.