How to rename a user with an eCryptfs encrypted home directory?












0














I just want to change the username of a user with an encrypted home directory. Is there a simple way instead of the suggested restoring and so forth?




  • How can i move an encrypted home directory to another partition?

  • How do I move my encrypted /home to a new computer?










share|improve this question



























    0














    I just want to change the username of a user with an encrypted home directory. Is there a simple way instead of the suggested restoring and so forth?




    • How can i move an encrypted home directory to another partition?

    • How do I move my encrypted /home to a new computer?










    share|improve this question

























      0












      0








      0







      I just want to change the username of a user with an encrypted home directory. Is there a simple way instead of the suggested restoring and so forth?




      • How can i move an encrypted home directory to another partition?

      • How do I move my encrypted /home to a new computer?










      share|improve this question













      I just want to change the username of a user with an encrypted home directory. Is there a simple way instead of the suggested restoring and so forth?




      • How can i move an encrypted home directory to another partition?

      • How do I move my encrypted /home to a new computer?







      home-directory ecryptfs user-management






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 30 '18 at 5:40









      LiveWireBT

      21.2k1770153




      21.2k1770153






















          1 Answer
          1






          active

          oldest

          votes


















          2















          1. It's best to unmount your home directory and execute the commands from another administrator account on the computer. You could use ecryptfs-umount-private or just reboot to unmount the directory.


          2. Change the login name and directory name from old_user to new_user:



            sudo usermod -l new_user -m -d /home/new_user old_user



          3. Here comes the important part for the proper configuration:




            • There exists a file named /home/.ecryptfs/$USER/.ecryptfs/Private.mnt it usually contains the following: /home/$USER


            • The following symlinks exist in your home directory when eCryptfs is not mounted:



              .ecryptfs -> /home/.ecryptfs/$USER/.ecryptfs
              .Private -> /home/.ecryptfs/$USER/.Private


            • Make sure that $USER in all these instances reflects the changes you intended to make, e.g. new_user. You can use nano to edit text files and ln -s to create new symlinks.





          You should be able to login again. I just tried it on my own. If you cannot log in through the GUI try from the terminal and check again that everything is in place.






          share|improve this answer





















          • Which version of Ubuntu does this work on? (Just in case it doesn't work on a future/past version)
            – Xen2050
            Dec 31 '18 at 23:41










          • @Xen2050 Based on this answer I'd say it should work on all non-EOL releases. In this example though I actually used Fedora 29. I made similar modifications to Ubuntu hosts years ago like providing an unencrypted .ssh/authorized_keys file for remote login, so I'd say once you understood where your data and configuration is and how the individual parts come together it's pretty basic and solid.
            – LiveWireBT
            Jan 1 at 0:42











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1105521%2fhow-to-rename-a-user-with-an-ecryptfs-encrypted-home-directory%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2















          1. It's best to unmount your home directory and execute the commands from another administrator account on the computer. You could use ecryptfs-umount-private or just reboot to unmount the directory.


          2. Change the login name and directory name from old_user to new_user:



            sudo usermod -l new_user -m -d /home/new_user old_user



          3. Here comes the important part for the proper configuration:




            • There exists a file named /home/.ecryptfs/$USER/.ecryptfs/Private.mnt it usually contains the following: /home/$USER


            • The following symlinks exist in your home directory when eCryptfs is not mounted:



              .ecryptfs -> /home/.ecryptfs/$USER/.ecryptfs
              .Private -> /home/.ecryptfs/$USER/.Private


            • Make sure that $USER in all these instances reflects the changes you intended to make, e.g. new_user. You can use nano to edit text files and ln -s to create new symlinks.





          You should be able to login again. I just tried it on my own. If you cannot log in through the GUI try from the terminal and check again that everything is in place.






          share|improve this answer





















          • Which version of Ubuntu does this work on? (Just in case it doesn't work on a future/past version)
            – Xen2050
            Dec 31 '18 at 23:41










          • @Xen2050 Based on this answer I'd say it should work on all non-EOL releases. In this example though I actually used Fedora 29. I made similar modifications to Ubuntu hosts years ago like providing an unencrypted .ssh/authorized_keys file for remote login, so I'd say once you understood where your data and configuration is and how the individual parts come together it's pretty basic and solid.
            – LiveWireBT
            Jan 1 at 0:42
















          2















          1. It's best to unmount your home directory and execute the commands from another administrator account on the computer. You could use ecryptfs-umount-private or just reboot to unmount the directory.


          2. Change the login name and directory name from old_user to new_user:



            sudo usermod -l new_user -m -d /home/new_user old_user



          3. Here comes the important part for the proper configuration:




            • There exists a file named /home/.ecryptfs/$USER/.ecryptfs/Private.mnt it usually contains the following: /home/$USER


            • The following symlinks exist in your home directory when eCryptfs is not mounted:



              .ecryptfs -> /home/.ecryptfs/$USER/.ecryptfs
              .Private -> /home/.ecryptfs/$USER/.Private


            • Make sure that $USER in all these instances reflects the changes you intended to make, e.g. new_user. You can use nano to edit text files and ln -s to create new symlinks.





          You should be able to login again. I just tried it on my own. If you cannot log in through the GUI try from the terminal and check again that everything is in place.






          share|improve this answer





















          • Which version of Ubuntu does this work on? (Just in case it doesn't work on a future/past version)
            – Xen2050
            Dec 31 '18 at 23:41










          • @Xen2050 Based on this answer I'd say it should work on all non-EOL releases. In this example though I actually used Fedora 29. I made similar modifications to Ubuntu hosts years ago like providing an unencrypted .ssh/authorized_keys file for remote login, so I'd say once you understood where your data and configuration is and how the individual parts come together it's pretty basic and solid.
            – LiveWireBT
            Jan 1 at 0:42














          2












          2








          2







          1. It's best to unmount your home directory and execute the commands from another administrator account on the computer. You could use ecryptfs-umount-private or just reboot to unmount the directory.


          2. Change the login name and directory name from old_user to new_user:



            sudo usermod -l new_user -m -d /home/new_user old_user



          3. Here comes the important part for the proper configuration:




            • There exists a file named /home/.ecryptfs/$USER/.ecryptfs/Private.mnt it usually contains the following: /home/$USER


            • The following symlinks exist in your home directory when eCryptfs is not mounted:



              .ecryptfs -> /home/.ecryptfs/$USER/.ecryptfs
              .Private -> /home/.ecryptfs/$USER/.Private


            • Make sure that $USER in all these instances reflects the changes you intended to make, e.g. new_user. You can use nano to edit text files and ln -s to create new symlinks.





          You should be able to login again. I just tried it on my own. If you cannot log in through the GUI try from the terminal and check again that everything is in place.






          share|improve this answer













          1. It's best to unmount your home directory and execute the commands from another administrator account on the computer. You could use ecryptfs-umount-private or just reboot to unmount the directory.


          2. Change the login name and directory name from old_user to new_user:



            sudo usermod -l new_user -m -d /home/new_user old_user



          3. Here comes the important part for the proper configuration:




            • There exists a file named /home/.ecryptfs/$USER/.ecryptfs/Private.mnt it usually contains the following: /home/$USER


            • The following symlinks exist in your home directory when eCryptfs is not mounted:



              .ecryptfs -> /home/.ecryptfs/$USER/.ecryptfs
              .Private -> /home/.ecryptfs/$USER/.Private


            • Make sure that $USER in all these instances reflects the changes you intended to make, e.g. new_user. You can use nano to edit text files and ln -s to create new symlinks.





          You should be able to login again. I just tried it on my own. If you cannot log in through the GUI try from the terminal and check again that everything is in place.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 30 '18 at 5:40









          LiveWireBT

          21.2k1770153




          21.2k1770153












          • Which version of Ubuntu does this work on? (Just in case it doesn't work on a future/past version)
            – Xen2050
            Dec 31 '18 at 23:41










          • @Xen2050 Based on this answer I'd say it should work on all non-EOL releases. In this example though I actually used Fedora 29. I made similar modifications to Ubuntu hosts years ago like providing an unencrypted .ssh/authorized_keys file for remote login, so I'd say once you understood where your data and configuration is and how the individual parts come together it's pretty basic and solid.
            – LiveWireBT
            Jan 1 at 0:42


















          • Which version of Ubuntu does this work on? (Just in case it doesn't work on a future/past version)
            – Xen2050
            Dec 31 '18 at 23:41










          • @Xen2050 Based on this answer I'd say it should work on all non-EOL releases. In this example though I actually used Fedora 29. I made similar modifications to Ubuntu hosts years ago like providing an unencrypted .ssh/authorized_keys file for remote login, so I'd say once you understood where your data and configuration is and how the individual parts come together it's pretty basic and solid.
            – LiveWireBT
            Jan 1 at 0:42
















          Which version of Ubuntu does this work on? (Just in case it doesn't work on a future/past version)
          – Xen2050
          Dec 31 '18 at 23:41




          Which version of Ubuntu does this work on? (Just in case it doesn't work on a future/past version)
          – Xen2050
          Dec 31 '18 at 23:41












          @Xen2050 Based on this answer I'd say it should work on all non-EOL releases. In this example though I actually used Fedora 29. I made similar modifications to Ubuntu hosts years ago like providing an unencrypted .ssh/authorized_keys file for remote login, so I'd say once you understood where your data and configuration is and how the individual parts come together it's pretty basic and solid.
          – LiveWireBT
          Jan 1 at 0:42




          @Xen2050 Based on this answer I'd say it should work on all non-EOL releases. In this example though I actually used Fedora 29. I made similar modifications to Ubuntu hosts years ago like providing an unencrypted .ssh/authorized_keys file for remote login, so I'd say once you understood where your data and configuration is and how the individual parts come together it's pretty basic and solid.
          – LiveWireBT
          Jan 1 at 0:42


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1105521%2fhow-to-rename-a-user-with-an-ecryptfs-encrypted-home-directory%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Questions related to Moebius Transform of Characteristic Function of the Primes

          List of scandals in India

          Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?