Usermod Under CentOS

Home » CentOS » Usermod Under CentOS
CentOS 2 Comments

My wife’s PC, running CentOS 6, suddenly quit connecting to the Net. Autodidact that I am, I fumbled with all the hard- and software I
could find or dared try, but did no good.

So we lugged it down to our favorite shop. While there, she bought a laptop, and asked them to install CentOS and copy all her files from the PC (including two books she’s written and is trying to market).

They called to ask whether I wanted to specify a username &
password, or just use their default dummies. I chose the dummies — and realized in the night that I’ve never changed a username before.

I think, repeat think, I could hack it with mv and chown, but I
had enough sense to try a few manuals and duckduckgo searches. Those eventually led me to usermod, and I took a look at ‘man usermod’. It seems to be fairly powerful — and therefore dangerous as well as apposite.

So I ask here: are there caveats, gotchas, and/or other entities of their ilk that I need be wary of?

2 thoughts on - Usermod Under CentOS

  • Beartooth wrote:

    Should we assume that you have another computer running, and that it’s not having network issues? What did dmesg say, or is this all water under the bridge?

    Try this: do a useradd for her, and perhaps for you. Then, as root, move the files to her home directory, and then chown -R herusername:hergroup
    *THEN* userdel the dummy accounts.

    That way, just in case they installed something you don’t want (incl. malware), will be disabled. Then you can poke around in the dummy home, etc, and when you don’t find anything you want, *then* rm -rf ~dummy


  • I’m not aware of any hard requirement that one’s home directory have the same name as the username.

    therefore, I think you could create a new user for her, and in
    /etc/passwd enter the existing home folder as her home.

    you might want to make sure you disable the old login.