Announcement

Collapse
No announcement yet.

How To Change User Name

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How To Change User Name

    You won't believe what I did...well maybe you will LOL. I somehow typed in the Wrong User Name - one letter - because my keyboard is not real good, brand new, but was not as good as the original I replaced. In fact it is so bad I may install Kubuntu on another computer. Sad because I like this laptop otherwise.

    Is it possible to Simply Change my User Name, or will it cause problems? I went to Settings Account Details and the only thing I can see to change is the 'Real Name'

    I don't really need to do this at this time, but would be nice to know how to do. The best documentation I see is the Official Ubuntu docs.
    https://help.ubuntu.com/lts/servergu...gement.html.en
    Dell OptiPlex 9010 SFF, 8GB RAM, i7 3770, Kubuntu 18.04, MB 051FJ8

    #2
    sudo usermod -l newUsername oldUsername
    sudo usermod -d /home/newHomeDir -m newUsername

    Please Read Me

    Comment


      #3
      Are you referring to your username here, in KFN?
      Using Kubuntu Linux since March 23, 2007
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        Originally posted by oshunluvr View Post
        sudo usermod -l newUsername oldUsername
        sudo usermod -d /home/newHomeDir -m newUsername
        I know and appreciate your knowledge oshunluvr, but have you even done this or had someone else do it? Seems simple and brilliant to me, and I seen something similar to this on the web.

        I saved it to a file and will attempt it asap, but don't want any headaches today. Working on a few other things too tonight and don't want to stall my forward momentum.

        Thanks, Nasty
        Dell OptiPlex 9010 SFF, 8GB RAM, i7 3770, Kubuntu 18.04, MB 051FJ8

        Comment


          #5
          Originally posted by Snowhog View Post
          Are you referring to your username here, in KFN?
          No Snowhog, typed in one wrong letter when I Reinstalled. The pc/User Name is not super important but I would really like to change it soon.
          Dell OptiPlex 9010 SFF, 8GB RAM, i7 3770, Kubuntu 18.04, MB 051FJ8

          Comment


            #6
            Check out the manpage for the command or click the link:man usermod

            It will show what all the different options are and the like.

            https://www.tecmint.com/usermod-command-examples/

            Another way would involve a bit more command line action than this easier, time-tested Unix command that predates Linux .

            Comment


              #7
              Originally posted by Nasty7 View Post
              I saved it to a file and will attempt it asap, but don't want any headaches today. Working on a few other things too tonight and don't want to stall my forward momentum.
              I've never had a need to do this. I understand your reticence, but we're not talking about a complicated operation. Your username is stored in the system like anything else. All you're changing is the /etc/passwd file and the folder name where your data is kept. Your actual user ID is a number - by default it's 1000 on *buntu systems - and that's not changing.

              If it were me, I'd log out of the GUI, log in in the terminal, "sudo -i" to root, run the commands above, and then reboot.

              Please Read Me

              Comment


                #8
                I'll do it as soon as I'm back on Kubuntu.

                I'd log out of the GUI
                You mean the Settings GUI?
                Dell OptiPlex 9010 SFF, 8GB RAM, i7 3770, Kubuntu 18.04, MB 051FJ8

                Comment


                  #9
                  Originally posted by Nasty7 View Post
                  I'll do it as soon as I'm back on Kubuntu.


                  You mean the Settings GUI?
                  No, I mean log out, then hit ALT-F2, and log in to text mode.
                  Last edited by oshunluvr; Jan 24, 2019, 09:44 AM.

                  Please Read Me

                  Comment


                    #10
                    Originally posted by oshunluvr View Post
                    No, I mean log out, then hit ALT-F2, and log in to text mode.
                    I was not able to do ALT-F2, or ALT-F1 or F2

                    Now, all I did was log out. I assumed this was to be done at Boot, by hitting ESC or something?

                    Thanks
                    Dell OptiPlex 9010 SFF, 8GB RAM, i7 3770, Kubuntu 18.04, MB 051FJ8

                    Comment


                      #11
                      That should have been to log out of Plasma, and at the log in screen, hit ctrl-alt-f2, and log in to the terminal there.

                      Comment


                        #12
                        LOG OUT is an option under Power/Session in the "kicker" menu. Then press CTRL-ALT-F2, which will bring a command prompt. Login with your current user and password. Then do what oshunlvr recommended. When your done, reboot and login with your new user.
                        The next brick house on the left
                        Intel i7 11th Gen | 16GB | 1TB | KDE Plasma 5.27.11​| Kubuntu 24.04 | 6.8.0-31-generic



                        Comment


                          #13
                          Originally posted by oshunluvr View Post
                          No, I mean log out, then hit ALT-F2, and log in to text mode.
                          I see, I thought there was something missing, the Ctrl! I'm very rusty with Linux stuff to be honest and am forced to use Windows more.

                          Still having Wifi issues so hope to figure that out, if not will move to another computer.

                          Thanks guys
                          Dell OptiPlex 9010 SFF, 8GB RAM, i7 3770, Kubuntu 18.04, MB 051FJ8

                          Comment


                            #14
                            sudo usermod -l newUsername oldUsername
                            sudo usermod -d /home/newHomeDir -m newUsername

                            I went wrong at "/newHomeDir" I think?

                            I did:

                            sudo usermod -l Work8 word-8: Which seemed to go okay.

                            Then here I tried a few things but none worked:
                            sudo usermod -d /home/newHomeDir -m newUsername

                            I didn't know what the "newHomeDir" would be?
                            sudo usermod -d /home/Work8 -m Work8
                            sudo usermod -d /home/newHomeDir -m newUsername

                            Old user name is word-8
                            New user name should be Work8
                            I'm guessing the Caps don't matter?
                            /home/Work8/ Maybe I should have put a "/" after Work8?
                            Like this:
                            sudo usermod -d /home/Work8/ -m Work8

                            I thought I botched the whole thing for a minute there, and it wasn't going to boot.
                            Dell OptiPlex 9010 SFF, 8GB RAM, i7 3770, Kubuntu 18.04, MB 051FJ8

                            Comment


                              #15
                              So assuming you can't get to
                              Code:
                              man usermod
                              the -l changes your login name from old to new, the -d changes the home directory to the new directory, and -m moves the contents of your directory to the new directory.
                              The next brick house on the left
                              Intel i7 11th Gen | 16GB | 1TB | KDE Plasma 5.27.11​| Kubuntu 24.04 | 6.8.0-31-generic



                              Comment

                              Working...
                              X