amf,
THIS works great! Thanks so much for the help.
amf,
THIS works great! Thanks so much for the help.
Well, I thought it worked great but it doesn’t.
I applied all these commands to the BBB in question and specifically to the root password entry but I am still unable to get into it.
When I attempt to log in with root, and enter a null password, I still get “access denied”. Same with all other usernames and passwords.
Could it be a file permissions problem?
debian@beaglebone:/mnt/media/etc$ su root
Password:
su: Authentication failure
debian@beaglebone:/mnt/media/etc$ su root
Password:
su: Authentication failure
debian@beaglebone:/mnt/media/etc$ sudo nano shadow
GNU nano 2.7.4 File: shadow
root::18717:0:99999:7:::
daemon::18112:0:99999:7:::
bin::18112:0:99999:7:::
sys::18112:0:99999:7:::
sync::18112:0:99999:7:::
games::18112:0:99999:7:::
man::18112:0:99999:7:::
lp::18112:0:99999:7:::
mail::18112:0:99999:7:::
news::18112:0:99999:7:::
uucp::18112:0:99999:7:::
proxy::18112:0:99999:7:::
www-data::18112:0:99999:7:::
backup::18112:0:99999:7:::
list::18112:0:99999:7:::
irc::18112:0:99999:7:::
gnats::18112:0:99999:7:::
nobody::18112:0:99999:7:::
systemd-timesync::18112:0:99999:7:::
systemd-network::18112:0:99999:7:::
systemd-resolve::18112:0:99999:7:::
systemd-bus-proxy::18112:0:99999:7:::
_apt::18112:0:99999:7:::
dnsmasq::18112:0:99999:7:::
messagebus::18112:0:99999:7:::
avahi::18112:0:99999:7:::
sshd::18112:0:99999:7:::
usbmux::18112:0:99999:7:::
lightdm::18112:0:99999:7:::
debian:rcdjoac1gVi9g:18112:0:99999:7:::
bob::18717:0:99999:7:::
[ Read 31 lines ]
^G Get Help ^O Write Out ^W Where Is ^K Cut Text ^J Justify ^C Cur Pos ^Y Prev Page M-\ First Line
^X Exit ^R Read File ^\ Replace ^U Uncut Text ^T To Spell ^_ Go To Line ^V Next Page M-/ Last Line
Try just removing the ‘x’ for your user in the ‘/etc/passwd’. This should allow for a login with asking for a password.Of course, backup your file and add a password once you can login.
Cheers,
Jon
I'm beginning to get lost in just what machine is which in this
discussion.
You obviously have some device that boots and lets you sign in. I'm
presuming you then mounted an SD card (or subdirectory of said card).
Note that, by default for quite some years, a stock Beaglebone does not
assign a password to the root account (or it is something impossible to
enter), and prevents direct login as root. Your "su root" is likely failing
for that reason. However, you do have sudo privileges (had you run sudo
recently before the above cut&paste -- on normal Beagle images, the first
run of sudo [and runs after some timeout period] prompt for the user
password, but you don't appear to have had to enter that).
Try entering
sudo su
or maybe
sudo bash
debian@beaglebone:~$ sudo su
[sudo] password for debian:
root@beaglebone:/home/debian# exit
exit
debian@beaglebone:~$ sudo bash
root@beaglebone:/home/debian# exit
exit
debian@beaglebone:~$
debian@beaglebone:~$ sudo cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
...
debian@beaglebone:~$ sudo cat /etc/shadow
root:$6$5qgZEu6UrcE6p.vz$HcTDnuyYnQDb3QCslR59OSMIor.Y4ugey8DNqPvoNDvZ8BFBZqIbQQkKBpf9SeT3Bma5xG8EsIX7bt1OWUKmV/:18493:0:99999:7:::
...
Granted, those are for the local machine. Have you tried "diff"ing the
running (eMMC?) version of the files with the files on the mounted SD? Also
compare the file owner/group and access (hmmm... group and gshadow files
too)
debian@beaglebone:~$ ls -l /etc
total 784
...
-rw-r--r-- 1 root root 1095 Feb 24 09:41 group
-rw-r--r-- 1 root root 1086 Oct 1 01:59 group-
-rw-r----- 1 root shadow 933 Feb 24 09:41 gshadow
-rw-r----- 1 root shadow 924 Oct 1 01:59 gshadow-
...
-rw-r--r-- 1 root root 1600 Aug 19 2020 passwd
-rw-r--r-- 1 root root 1533 Aug 19 2020 passwd-
...
-rw-r----- 1 root shadow 934 Aug 19 2020 shadow
-rw-r----- 1 root shadow 902 Aug 19 2020 shadow-
...
debian@beaglebone:~$
Unless you've created a lot of custom users on the SD card, it could be
worth just copying the files (using sudo) from the running machine to the
SD card, and verifying (ls) they have the correct privileges/owner/group
after the copy.
Jon,
I tried your suggestion but am still unable to log in as root. I’m still being asked for a password for root.
Bob
Bob,
If you removed the crypted password from the shadow file, that may cause an issue. If you still have that original file, I would put it back in place and try again. If none of this is working, then it would appear something happened to the config. As you mentioned previously, it could be the permissions of the files.
Denis,
I have a stock BBB and the root password is root. I did not change that. I can access it via su with password of root or sudo su with the debian password. I did not set these. However, I can not login as root from a remote ssh session since that is disabled in the sshd_config. From serial port I can with root/root.
Jon
I’m going out on the limb here, but putty seem to have an issue with logins without a password. I’m sure some one can provide more input on this.
I was able to use PuTTY on Windows 10 to login to the BBB via serial without root password after editing the /etc/passwd file. Typically the root account is set in the sshd_config to not allow remote ssh connections to a Linux system. You have to set this to allow for root login with or without a password.
https://linuxconfig.org/enable-ssh-root-login-on-debian-linux-server
Jon
Exactly what I needed, passwd by itself was not updating the debian password.
Thanks.