Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9880 Discussions

How to remove/reset root password

idata
Community Manager
1,107 Views

Hi,

After booting intel Edison board, go to root and it asks for a password.

I want to remove or reset this password.

Please find attached snap for reference.

Please assist.

Thanks in advance,

Amit Amrutkar

0 Kudos
1 Solution
idata
Community Manager
221 Views

Hi Amit,

 

 

You would have to modify the file /etc/shadow. Follow the steps below to delete the root password:

 

 

1. Run the command: cat /etc/shadow | grep root

 

2. Copy the output from the command above. This is the information of your root account. You will see something like root:sdfhowe934rbwg23:11111:0:99999:7:::. What it's important here is the string located between the first two colon marks. This is your current password which is encrypted. If you want to remove it, you have to delete that string.

 

3. Run the following command to remove the password: sed -i "1s/.*/[root::.....]/" /etc/shadow

 

 

Note the brackets in the command above. You will have to copy the same output you got previously but without the string that corresponds to the encrypted password. If your original output was for example: root:sdfhowe934rbwg23:11111:0:99999:7:::, then you have to use the following string: root::11111:0:99999:7:::, so the command should look like sed -i "1s/.*/root::11111:0:99999:7:::/" /etc/shadow

 

 

Then, if you run the following command again, the password shouldn't be there: cat /etc/shadow | grep root. If so, reboot the board. The next time you try to access the console, you shouldn't have to enter a password.

 

 

Regards,

 

Diego

View solution in original post

1 Reply
idata
Community Manager
222 Views

Hi Amit,

 

 

You would have to modify the file /etc/shadow. Follow the steps below to delete the root password:

 

 

1. Run the command: cat /etc/shadow | grep root

 

2. Copy the output from the command above. This is the information of your root account. You will see something like root:sdfhowe934rbwg23:11111:0:99999:7:::. What it's important here is the string located between the first two colon marks. This is your current password which is encrypted. If you want to remove it, you have to delete that string.

 

3. Run the following command to remove the password: sed -i "1s/.*/[root::.....]/" /etc/shadow

 

 

Note the brackets in the command above. You will have to copy the same output you got previously but without the string that corresponds to the encrypted password. If your original output was for example: root:sdfhowe934rbwg23:11111:0:99999:7:::, then you have to use the following string: root::11111:0:99999:7:::, so the command should look like sed -i "1s/.*/root::11111:0:99999:7:::/" /etc/shadow

 

 

Then, if you run the following command again, the password shouldn't be there: cat /etc/shadow | grep root. If so, reboot the board. The next time you try to access the console, you shouldn't have to enter a password.

 

 

Regards,

 

Diego
Reply