# HOW TO CHANGE USERNAME AND PASSWORD ON RASPBERRYPI
###### tags: `RPi` `username`
## First step:
#### Choose a secure password for the root user
```
sudo passwd root
```
## Second step:
#### Press the icon on the upper left of the screen 
1. ##### Press Preference >> RaspberryPI Configuration
2. ##### Deny the option of logging in as the user 'pi'
#### Shut down raspberrypi
## Third step:
#### Select logging in as other user and login as the user 'root' using the password you just created.
```
usermod -l <newname> pi
usermod -m -d /home/<newname> <newname>
```
#### Then you can login back to the user with newname(Default password: raspberry)
## Last step:
#### Changing your password for raspberrypi
```
sudo passwd
```
#### Check the following update command works:
```
sudo apt-get update
```
#### If it works then you can disable the root account by locking the password:
```
sudo passwd -l root
```
## Reference:
https://thepihut.com/blogs/raspberry-pi-tutorials/how-to-change-the-default-account-username-and-password