Nantes Université

Skip to content
Extraits de code Groupes Projets

Create and migrate to an encrypted user

  • Cloner avec SSH
  • Cloner avec HTTPS
  • Intégrer
  • Partager
    L'extrait de code peut être consulté sans aucune authentification.
    Rédigé par Erwan BOUSSE
    Modifié
    migrate-encypted-user.sh 940 o
    # (1) Install required dependency to encrypt a user home
    sudo apt-get install ecryptfs-utils
    
    # (2) Create new user with encrypted home
    sudo adduser --encrypt-home REPLACE_WITH_USERNAME
    
    ####################
    # (3) When asked, type the password that was given to you, 
    #     then press ENTER for each additional data asked 
    ####################
    
    ####################
    # (4) When this is done, you must now logout and open a new session with the new account
    ####################
    
    # (5) Only once you are logged in with new user, retrieve data from old user 'naomod'
    sudo cp -rv /home/naomod /home/REPLACE_WITH_USERNAME/old_home
    
    ####################
    # (6) When this is done, you must check thoroughly that you know have everything you need 
    #     in the 'old_home' home folder, and that 'naomod' can be deleted
    ####################
    
    # (7) Only once you are 100% sure all you data has been copied, delete old user account
    sudo userdel -r naomod
    0% Chargement en cours ou .
    You are about to add 0 people to the discussion. Proceed with caution.
    Terminez d'abord l'édition de ce message.
    Veuillez vous inscrire ou vous pour commenter