Root login failure (ask password)

Hello Everyone,
I have an issue to login with the “root” user.
Before it worked very well by “root” with an empty password.
But now when I use the login by “root”, it asks me the password. But I don’t have the password. I try password like “root”, empty… But I am failed.

More information:

  1. I don’t change anything
  2. I can login with another user with its password
  3. I have a big file /var/logs/btmp (I don’t know if this can be a problem or not)
  4. The memory used is 95% cause by btmp.

Can you help me thank you.

I also had this issue multiple times in the past and was not able to figure it out correctly, so I would also be interested in a correct solution.

Until now when I had the issue I rebuild the Yocto-project and reflashed the image and then it worked again…

Hi @gongfu , You mentioned that you “disk space” is 95% full? It’s a really bad situation for NAND based storage. In some cases you may have start experiencing files corruption. And corruption of the file with a password hashes can lead to a problem you are observing.

Could you please post output of ubinfo /dev/ubi0 command?

Dear @gongfu,

Thanks for reaching out to Toradex.

It would be interesting to know more about your setup. What SoM are you using and what carrier board?
Furthermore, if you’re willing to share more about your project we can help you even more.

Now, are you able to enter root by going through another user by using sudo? The large file you found under /var/logs/btmp, is actually used to log failed login attempts. It should not be an issue to clear this file.

To get further information you can also look at the file /var/log/auth.log, there you might find the reason why the login fails.

Best Regards
Kevin

Dear @kevin.tx ,
Thank you for your reply.

I have below board:
Col VF50 128MB V1.2A + Iris Rev 1.1 Board + image Colibri-VF_Console-Image 2.8b6.184 20190401

My project is simply: This board is used to receive the reverse SSH command and control remote board. (There are others Vol VF50 send reverse SSH command). I think that’s why the file /var/logs/btmp is big. I can’t remove (rm /var/logs/btmp) this file, because it asks root permission.

I have already this issue before. The first time when I have this issue, I reflashed the image. It works. But this time I’d like to resolve this problem.

When I use the sudo command with the second user, I have the message -sh: sudo: not found

I try su command. but it asks me for the password. I try several password but it doesn’t work

I don’t have the file /var/log/auth.log. In the var/log, I have only below file or folder:
btmp, journal, lastlog, postinstall.log, wtmp, xferlog

Best regards,

Hello @alex.tx

Thank you for your reply.
Yes alt text

Yes the disk space is about 95%. I try to remove some thing. The problem is I can’t remove the /var/logs/btmp file.
-rw------- 1 root utmp 120996864 Feb 22 14:56 btmp

When I use “ubinfo /dev/ubi0”, I have message -sh: ubinfo: not found

More detail:
After I login with the second user, I have a message below: [ 87.716643] systemd-journald[95]: File /var/log/journal/a1f9c4f585494a1b83c2c5f60bb611b4/user-1000.journal corrupted or uncleanly shut down, renaming and replacing.
-sh: .: line 27: can’t open ‘/etc/profile.d/utf8.sh’

Dear @gongfu,

Thanks for providing the detailed information.

Could you please check, if the path to the system directory is correct by typing echo $PATH ?

Also type the command whereis sudo, and add that path to the $PATH, if not already there. Can you access root now?

Best Regards
Kevin

When I type “echo $PATH”, I have the reply: /usr/local/bin:/usr/bin:/bin

When I type whereis sudo, I have -sh: whereis: not found

(I try another VF50 which no problem, I have the same message for whereis sudo. So this version Linux doesn’t have whereis command).

Dear @gongfu,

it seems to me that both directories with root privileges are missing.
Try to add them to the path by executing the command export PATH=/usr/sbin:/sbin/:$PATH.

This is only a temporary change. If this gives you access to root, you can add the command to the ./bash.rc file, to make the change permanent. You do this by entering nano ~./bashrc and adding the export command above to the file.

Let me know if you had success.

Best Regards
Kevin

I try to entry export PATH=/usr/local/sbin:/usr/sbin:/sbin/:$PATH (I see /usr/local/sbin in other VF50 board )

I have below PATH with echo $PATH command.
/usr/local/sbin:/usr/sbin:/sbin/:/usr/local/bin:/usr/bin:/bin

I can’t enter root user by “sudo” command. => -sh: sudo: not found

I try to add the export PATH command in the bash.rc. with “vi ~./bash.rc”. When I want to save the file, I have a message error, bash.rc doesn’t exist. So I can’t save it.

Now I can have the “ubinfo /dev/ubi0” like below:
ubi0
Volumes count: 3
Logical eraseblock size: 126976 bytes, 124.0 KiB
Total amount of logical eraseblocks: 1002 (127229952 bytes, 121.3 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes 128
Count of bad physical eraseblocks: 6
Count of reserved physical eraseblocks: 14
Current maximum erase counter value: 2481
Minimum input/output unit size: 2048 bytes
Character device major/minor: 247:0
Present volumes: 0, 1, 2

Form your ubinfo /dev/ubi0 output - Amount of available logical eraseblocks: 0
It means your system can not be run normally anymore. You should always keep free at least 20% of you storage space.

Ok Thank you.
So now there is no more solution for this issue and I need to reflash the board? Or I need to delete some files to have min 20% memory?

Dear @gongfu,

If your able to do so, I would suggest you try first to free up space on your device. Only if you are not able to do so, the next step would be to reflash the board.

After successfully reflashing, I suggest tracking which application is filling up your disk space.

Best Regards
Kevin

I have the same problem using su.

sudo works with the password I always use, but when I try su, it asks for a password then always says
su: Authentication failure

Now I realized I am supposed to type:

$ sudo su

Then it works (with torizon and the password I set)