Skip to main content
improved formating
Source Link
Ghanima
  • 15.9k
  • 16
  • 63
  • 120
  1. $ sudo passwd rootsudo passwd root
    [enter new ridiculous root password. Remember it.]
  2. Log/ssh into pi as root using ridiculous password.
  3. $ usermod -l newname -d /home/newname -m oldnameusermod -l newname -d /home/newname -m oldname
  4. $ ls -al /home/ls -al /home/
    [See that you've changed the user & home folder. Yay. Oh.. gotta change the group...]
  5. $ groupmod --new-name newname oldnamegroupmod --new-name newname oldname
  6. $ ls -al /home/ ls -al /home/
    [See that user, group & home folder are changed. Yay!]
  7. $ exitexit
    (Now log in as newname. Yay!)
    But wait....
    Now you should reset root so others can't brute-force your ridiculous password.
  8. $ sudo passwd -l rootsudo passwd -l root
    (Oh, and if you REALLY care... edit /etc/ssh/sshd_config/etc/ssh/sshd_config, setting "PermitRootLogin no", and restart that service.)

Then you'll have to change any additional changes in any scripts/setups that refer to 'pi'... JOY.

  1. $ sudo passwd root
    [enter new ridiculous root password. Remember it.]
  2. Log/ssh into pi as root using ridiculous password.
  3. $ usermod -l newname -d /home/newname -m oldname
  4. $ ls -al /home/
    [See that you've changed the user & home folder. Yay. Oh.. gotta change the group...]
  5. $ groupmod --new-name newname oldname
  6. $ ls -al /home/
    [See that user, group & home folder are changed. Yay!]
  7. $ exit
    (Now log in as newname. Yay!)
    But wait....
    Now you should reset root so others can't brute-force your ridiculous password.
  8. $ sudo passwd -l root
    (Oh, and if you REALLY care... edit /etc/ssh/sshd_config, setting "PermitRootLogin no", and restart that service.)

Then you'll have to change any additional changes in any scripts/setups that refer to 'pi'... JOY.

  1. sudo passwd root
    [enter new ridiculous root password. Remember it.]
  2. Log/ssh into pi as root using ridiculous password.
  3. usermod -l newname -d /home/newname -m oldname
  4. ls -al /home/
    [See that you've changed the user & home folder. Yay. Oh.. gotta change the group...]
  5. groupmod --new-name newname oldname
  6. ls -al /home/
    [See that user, group & home folder are changed. Yay!]
  7. exit
    (Now log in as newname. Yay!)
    But wait....
    Now you should reset root so others can't brute-force your ridiculous password.
  8. sudo passwd -l root
    (Oh, and if you REALLY care... edit /etc/ssh/sshd_config, setting "PermitRootLogin no", and restart that service.)

Then you'll have to change any additional changes in any scripts/setups that refer to 'pi'... JOY.

Source Link

  1. $ sudo passwd root
    [enter new ridiculous root password. Remember it.]
  2. Log/ssh into pi as root using ridiculous password.
  3. $ usermod -l newname -d /home/newname -m oldname
  4. $ ls -al /home/
    [See that you've changed the user & home folder. Yay. Oh.. gotta change the group...]
  5. $ groupmod --new-name newname oldname
  6. $ ls -al /home/
    [See that user, group & home folder are changed. Yay!]
  7. $ exit
    (Now log in as newname. Yay!)
    But wait....
    Now you should reset root so others can't brute-force your ridiculous password.
  8. $ sudo passwd -l root
    (Oh, and if you REALLY care... edit /etc/ssh/sshd_config, setting "PermitRootLogin no", and restart that service.)

Then you'll have to change any additional changes in any scripts/setups that refer to 'pi'... JOY.