Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Catch-22

If none of the specific sub-forums seem right for your thread, ask here.
Message
Author
PieterB
Posts: 5
Joined: 2020-09-23 12:50

Catch-22

#1 Post by PieterB »

Hi

I just got a BeagleBone Black. It comes with Debian pre-installed. I'm a Linux knucklehead.

So, in order to set a static IP and the DNS to 8.8.8.8, I edited some files, and removed connman. It works.

I struggled to edit some files, so I changed the permission on /etc to free-for-all. Something in the line of rwxrwxrwx or something.

I need to change some things, but I can't:

I don't know what the root password is, (on the BBB it should be empty, but it isn't.)
So I can't login as root.
I have to log in as 'debian'
But I can't do things as 'sudo', I get the following.

sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin


My sudoers file contains
%sudo ALL=(ALL:ALL) ALL

and I've edited it to also contain
debian ALL=(ALL) ALL and also
debian ALL=(ALL:ALL) ALL

but is still does not work.

It seems that Debian realizes that the sudoers file is 'world writable', and then ignores the content of the sudoers file - i.e. even if a user is given sudo rights in the sudoers file, Debian will still not allow him to sudo.
But since I need to sudo in order to set the permissions on /etc to whatever it should be, I cannot change the permissions on /etc

Although this is a BeagleBone Black, I'd guess that the problem would be generic to Debian (Linux)?

Anyway, any suggestions?

User avatar
fred44nl
Posts: 215
Joined: 2018-07-14 08:54
Has thanked: 1 time

Re: Catch-22

#2 Post by fred44nl »

you will have to add yourself to the group sudo
in Terminal you type "su -" (without quotes)
you will have to enter your password.
next you issue the command "/usr/sbin/usermod -aG sudo debian" (without quotes)
the result can be checked with "cat /etc/group | grep sudo" (without quotes)
reboot is required to become effective
Debian 10 - Buster on Compulab Fitlet2
Debian 12 - Bookworm on Acer Spin 1

PieterB
Posts: 5
Joined: 2020-09-23 12:50

Re: Catch-22

#3 Post by PieterB »

Thanks for your reply!

I get:


debian@beaglebone:/etc$ su -
Password:
su: Authentication failure


(I types in my 'debian' password, which is 'temppwd' )

PieterB
Posts: 5
Joined: 2020-09-23 12:50

Re: Catch-22

#4 Post by PieterB »

I can edit /etc/group though (I can edit everything in /etc)
Maybe I can just edit the /etc/group file?

(
when I do:
cat /etc/group | grep sudo

I get:
sudo:x:27:
)

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

Re: Catch-22

#5 Post by sgosnell »

Try asking here for the default root password: https://beagleboard.org/Community/Forum ... orum_embedI'm under the impression that the board uses a modified version of Debian, not the mainline version. I could be wrong, but that has been what I've casually read. I have no real knowledge of the device, but the folks on the appropriate forum should be able to help. There seems to be a separate forum for each variant, so pick the one you have, or perhaps use the general Beaglebone forum. You're much more likely to find specific help there.
Take my advice, I'm not using it.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: Catch-22

#6 Post by dilberts_left_nut »

PieterB wrote:so I changed the permission on /etc to free-for-all. Something in the line of rwxrwxrwx or something.
That was a very poor idea - your system is now broken - reinstall.

Alternatively, you can boot from another media and reset permissions on everything under /etc to all the different things that they should be - many hours of fun to be had there!
AdrianTM wrote:There's no hacker in my grandma...

User avatar
fred44nl
Posts: 215
Joined: 2018-07-14 08:54
Has thanked: 1 time

Re: Catch-22

#7 Post by fred44nl »

PieterB wrote: (
when I do:
cat /etc/group | grep sudo

I get:
sudo:x:27:
)
when you do
cat /etc/group | grep sudo

you should get
sudo:x:27:debian

as debian is the username you have choosen
Debian 10 - Buster on Compulab Fitlet2
Debian 12 - Bookworm on Acer Spin 1

User avatar
fred44nl
Posts: 215
Joined: 2018-07-14 08:54
Has thanked: 1 time

Re: Catch-22

#8 Post by fred44nl »

sgosnell wrote:Try asking here for the default root password
when you did install Debian, you were asked for a username, where you have choosen "debian".
you were also asked to give a password for that user.

and that is the password you should use when you use the command "su -"
Debian 10 - Buster on Compulab Fitlet2
Debian 12 - Bookworm on Acer Spin 1

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

Re: Catch-22

#9 Post by sgosnell »

I just got a BeagleBone Black. It comes with Debian pre-installed.
He didn't do the installation.
Take my advice, I'm not using it.

sgage
Posts: 86
Joined: 2013-03-10 21:00
Has thanked: 1 time
Been thanked: 2 times

Re: Catch-22

#10 Post by sgage »

dilberts_left_nut wrote:
PieterB wrote:so I changed the permission on /etc to free-for-all. Something in the line of rwxrwxrwx or something.
That was a very poor idea - your system is now broken - reinstall.

Alternatively, you can boot from another media and reset permissions on everything under /etc to all the different things that they should be - many hours of fun to be had there!
This. Just reinstall - far and away the easiest way to go.

reinob
Posts: 1196
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: Catch-22

#11 Post by reinob »

fred44nl wrote:
sgosnell wrote:Try asking here for the default root password
when you did install Debian, you were asked for a username, where you have choosen "debian".
you were also asked to give a password for that user.

and that is the password you should use when you use the command "su -"
Note that "su -" will su to root, and hence ask for root's password.
You were thinking sudo, I guess.

PS: to the OP: reinstall, and RTFM before you make /etc world writable!

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

Re: Catch-22

#12 Post by sgosnell »

The Beaglebone version is installed by writing the .iso to a microSD card, not in the usual way it is done on a PC. One still needs the default root and user passwords. Those should be easily available on the Beaglebone forums, or though some elementary googling.
Take my advice, I'm not using it.

PieterB
Posts: 5
Joined: 2020-09-23 12:50

Re: Catch-22

#13 Post by PieterB »

sgosnell wrote:... One still needs the default root and user passwords. Those should be easily available on the Beaglebone forums, or though some elementary googling.
Yes, except that it isn't. According to all the info available on Google and the BBB forums, the default debian 'root' password is supposed to be empty. Failing that, and rarely, it could be temppwd. None of those work, including desperation attempts such as "", '', blank, Blank, BLANK, "blank" and so forth. (Maybe they sent me a returned device on which the original owner meddled with the password - but I rather doubt that).

Anyway, thanks for caring. I'm just going to follow the general consensus and nuke the thing - which I hoped to avoid, since it means that I need to buy some other stuff.

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: Catch-22

#14 Post by kedaha »

Hi,
You might try the command
sudo su -
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

reinob
Posts: 1196
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: Catch-22

#15 Post by reinob »

kedaha wrote:Hi,
You might try the command
sudo su -
but he broke sudo (see first post), and can't su to root, because the root password is unknown.
he should reinstall and avoid breaking /etc

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: Catch-22

#16 Post by sickpig »

PieterB wrote:Anyway, thanks for caring. I'm just going to follow the general consensus and nuke the thing - which I hoped to avoid, since it means that I need to buy some other stuff.
this can help http://forums.debian.net/viewtopic.php?f=16&t=146740

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: Catch-22

#17 Post by kedaha »

Or maybe just sudo su without the hyphen as detailed in this link:
beaglebone-and-the-root-superuser?
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

reinob
Posts: 1196
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: Catch-22

#18 Post by reinob »

kedaha wrote:Or maybe just sudo su without the hyphen as detailed in this link:
beaglebone-and-the-root-superuser?
Please read again the first post :)
sudo is not working in his installation anymore, because he made /etc world-writable.

Code: Select all

sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
Whatever he does to fix his problem, he cannot use sudo.

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: Catch-22

#19 Post by kedaha »

Ha! I was assuming he would've reinstalled as advised.
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

PieterB
Posts: 5
Joined: 2020-09-23 12:50

Re: Catch-22

#20 Post by PieterB »

Okay, just to bring closure to this, as info for anyone at all interested, and as a guide for anyone who worked themselves into a similar situation:

I did indeed re-install debian on my BeagleBone Black.

That involved buying a USB/microHD Card Reader, and an 8Gb microSD card, downloading and installing the balenaEtcher tool on my laptop, and downloading the latest BBB debian image from the Beaglebone site.
https://www.balena.io/etcher/
https://beagleboard.org/latest-images

There are 2 debian images, one is intended to configure the microSD as a boot source, and the other is to automatically flash the debian image to the BBB eMMC on-board flash storage after it has booted (referred to as "Flasher" images). I chose the latter.

I then wrote the image I downloaded to the microSD card using 'BalenaEtcher'.

After the image is written, you power down the BBB, insert the microSD it into the BBB card slot, and re-apply power while holding down the 'Boot' button on the BBB, which causes it to boot from the microSD instead of the eMMC. Since I downloaded the image which transfers itself to the eMMC after boot, that is what it did. In the process, it powered down the BBB a few times, so I just removed the power source and re-applied it every time. (O yes, I'm using the 5V power socket on the BBB with a 5V DC power supply).

The new debian image I downloaded is somewhat different from the one that came pre-installed, and I recommend the above procedure for anyone as a first step after getting a new BBB.
The Browser interface is very different and includes a fully-fledged development IDE, together with some sample projects.

Setting up a static IP is a lot easier, and does not seem to stuff-up the BBB's concept of a DNS, which happens on the pre-installed debian.

O yes, and I can now 'sudo'.
I still do not know what the root password is, but I can do "sudo su -" with the 'debian' password which makes me a super user, so I can probably set the root password myself, or at least find out what it is.

(I'd like to know what the root password is, because I'd rather edit system configuration files with WinSCP than with nano or vim or whatever, and you can only do that with WinSCP of you have root access to those files. Which is why I gave universal privileges to the /etc folder to begin with).

Anyway, thanks for the feedback. Maybe this can be helpful to some others, as well.

Post Reply