Announcement

Collapse
No announcement yet.

How To Change User Name

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

    #16
    What would the new Directory look like if it were "Work8"?

    Do Caps matter?

    I poste this but you did not comment on it: sudo usermod -d /home/Work8/ -m Work8
    I will try this next

    I don't find man very useful as there are never any examples.
    Dell OptiPlex 9010 SFF, 8GB RAM, i7 3770, Kubuntu 18.04, MB 051FJ8

    Comment


      #17
      Sorry, my bad leaving out CTRL. I've used that command for so long I never even thing about what I'm typing anymore.

      As far as "Do Caps matter?" - only in the way that Linux commands are case sensitive. As long as you remember it's capitalized, you won't have problems. They're just labels.

      I think the main reason everything (almost) is in lower case is to make typing easier and so you don't have to "know" that one command or another has upper case letters in it.

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

      Changing the home folder is about half way down the webpage. Your command looks right to me.

      Please Read Me

      Comment


        #18
        Sweet, I'll get er done today!
        Dell OptiPlex 9010 SFF, 8GB RAM, i7 3770, Kubuntu 18.04, MB 051FJ8

        Comment


          #19
          Still don't work, looks a little more complicated from my research, though will do some more when I get time. I will also just consider creating another account, and delete the old one.

          And, I don't want to waste more time of you guys, this is not super important, but I did want to learn if it was possible and see how hard it was.

          I think I will use this install to practice some more stuff and then eventually Torch it. This laptop don't seem to like Linux very well, and still having Wifi issues. I'll take it day by day, and see where it ends up.

          1. I may buy another wifi card and see if that fixes some stuff.

          2. I may try another distro also, if that makes things work better.

          3. May also get an SSD if I can make things work, and use the HDD in this thing now for anther computer.

          4. I mentioned in another thread that there were issues with my Bookmarks Bar Folders, and taking too long to form a Dropdown. Now I see that it is only the ones that have the most bookmarks, the ones that have only 5-10 work just fine. The ones that have like 30 are much slower, but not on other distros and OS's.

          Thanks guys
          Last edited by Nasty7; May 26, 2019, 11:03 AM. Reason: More info
          Dell OptiPlex 9010 SFF, 8GB RAM, i7 3770, Kubuntu 18.04, MB 051FJ8

          Comment


            #20
            Originally posted by Nasty7 View Post
            Still don't work, looks a little more complicated from my research, though will do some more when I get time. I will also just consider creating another account, and delete the old one.
            You didn't say why it didn't work. Was there an error message?

            I got it to work, but I had to do it logged in as root. Kind of obvious this would be required but I didn't see it stated anywhere. You could alternately log in as a different user that has admin rights, but you can't "usermod" the user you're logged in as.
            I booted a VM, logged in, created a root password.
            Rebooted.
            I did not log into the GUI, instead I immediately hit CTRL-ALT-F2
            I logged in as "root" with my new root password.
            Used the usermod command.
            Observed the home directory had changed.

            Then you would only need to remove the root password again and you'd be back where you started, only with a new home folder.

            I re-read an above post of your and realized you may have read more into this command than is there. usermod -d -m only moves (renames) the home folder and changes the location setting for that user (in /etc/passwd) nothing else. This would not rename the user at the same time. to do that the command would be like this:

            usermod -l <newname> -d /home/<newname> -m <oldname>

            so in your case:

            usermod -l Work8 -d /home/Work8 -m word-8

            Please Read Me

            Comment


              #21
              I thought this was logging me in as root 'sudo -i'

              Then I tried 'sudo su'

              This was the outcome of my attempt after running 'sudo -i':
              Code:
              sudo usermod -l Work8 word-8
              Error 'user word-8 is currently used by process 1101'
              I booted a VM, logged in, created a root password.
              I didn't see that this was necessary.

              I'll review your post and try it again.

              Your original quote for my reference:

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

              Just looked at the man page and see what you're doing now, makes more sense as I move forward. This example was key to me understanding. Pretty brilliant of linux that you can just string all those together.
              'usermod -l Work8 -d /home/Work8 -m word-8'

              One person on superuser.com said this would cause all kinds of permission issues.
              "I would recommend not attempting to change a user's name. This is generally wrought with problems when the user's name is statically referenced in configuration files in the form of the user's home directory, /home/<username>. These are almost never written in a generic way so it's usually best to just create a new username and then migrate the user's files and data over to the new account."
              Proper way of changing username in Ubuntu or any linux

              Last edited by Nasty7; May 27, 2019, 10:16 AM.
              Dell OptiPlex 9010 SFF, 8GB RAM, i7 3770, Kubuntu 18.04, MB 051FJ8

              Comment


                #22
                Yeah, I had to actually set the root password and reboot, then don't log in as your user at all.

                Some process was running because I had logged in and logging out didn't kill it. Since I was doing it in a VM a reboot was easier than trying to figure out which thing(s) needed to be killed. I do believe it was some systemd process, but I didn't bother to look at it.

                Please Read Me

                Comment


                  #23
                  I had to actually set the root password and reboot, then don't log in as your user at all.
                  I'll have to try that then, but will need to look it up as I don't know how to do it.

                  I did do kill PID-1114 or whatever that command is, with the proper user PID, on another machine now and don't have all my links and notes. But kill PID did not work either.
                  Dell OptiPlex 9010 SFF, 8GB RAM, i7 3770, Kubuntu 18.04, MB 051FJ8

                  Comment

                  Working...
                  X