Hi
i have ubuntu it was working fine but now i cannot execute any command
no sudo i cannot go to group and user etc..
any help please

Dani AI

Generated

Short summary and practical next steps (root cause + safe options)

The most likely root cause is a recursive permission change under system directories (as identified). When files under /usr and /etc lose their original ownerships, setuid bits and restrictive modes, core tools (sudo, init scripts, networking, daemons) can refuse to run and the system becomes unreliable. That explains the “must be only be writable by owner” plugin error and the other symptoms you describe.

Before trying repairs: back up user data and an image of the disk. If you can, boot a live USB and copy /home or create an image (Clonezilla or an rsync copy). Save the installed package list so you can reinstall the same packages later:

dpkg --get-selections > ~/packages-list.txt

Two realistic repair approaches

  1. Repair in-place (advanced). From a live USB, mount your root partition, bind-mount /proc /sys /dev and chroot. Verify ownership/mode of the critical sudo-related files and restore them to root ownership and secure modes (the sudo binary must be owned by root and have the setuid bit; sudoers and files in /etc/sudoers.d must be root-only readable; the sudo plugin library must not be group/other-writable). Use stat to show current mode/owner before changing anything:

    stat -c '%a %U %G %n' /usr/bin/sudo /etc/sudoers /usr/lib/sudo/sudoers.so

    After that, reinstall the core packages (sudo, coreutils, apt, login/systemd) via apt to restore package-supplied permissions.

  2. Reinstall (safer for many users). If the permission damage is broad or you are unsure, backup and do a fresh install. If /home is on a separate partition you can preserve it during reinstall (as suggested); otherwise restore your backups after reinstall.

If attempting repair, post the stat output for the three files shown above and the output of a quick scan for world-writable files under /usr (from a live environment) so helpers can give exact commands. Avoid more broad recursive chmods — they cause the problem.

Recommended Answers

All 13 Replies

I have no idea... What the error when you try to use command sudo? Would it be ? Or would it be unable to resolve?

Did you make a new user and it doesn't have sudo permissions?

You are not providing nearly enough information to help you. Saying "I have a problem - please fix it." is not productive. Tell us what your were doing when it stopped working, and what you did just before it stopped working, IN DETAIL.

HI
no i did not make any new user..
i cannot install any software via the terminal i cannot add or view user and groups..and if i write sudo in terminal i get this error
sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner
sudo: fatal error, unable to load plugins

Did you run some kind of CHMOD -R command on that path? / or /usr or /usr/lib ?

Can you check your history?
history | grep chmod

You could try a very nice trick which I used recently to restart a ubuntu PC without the password

- Restart the computer and in Grub, choose *Recovery Mode*
- In the menu, choose *root*
- In the terminal type
    mount -o rw,remount /
    passwd <YOUR USER NAME>
    reboot

After the mount, you're root and you should be able to install software.

not working with recovery mode
history of chmod

34  chmod +x netbeans.sh
   37  chmod +x netbeans.sh
   45  sudo chmod a+x eclipse
   46  sudo chmod a+x eclipse.run
   50  chmod +x eclipse.run
   51  chmod -R 777 /local/java
   52  chmod -R 777 /local/java
   54  chmod -R 777 /local
   55  chmod -R 777 / local
   56  chmod -R 777 / local /java
   57  chmod -R 777 /local/java
   58  chmod -R 777 /local/java
   59  sudo chmod -R 777 /local/java
   60  sudo chmod -R 777 /local
   63  sudo chmod -R 777 usr/local/java
   65  sudo chmod -R 777 usr/local/java
   67  sudo chmod -R 777 usr/local
   68  sudo chmod -R 777 usr /local
   69  sudo chmod 754 /usr/local/java
   72  sudo chmod 755 /usr/local/java
   73  chmod 775 /usr/folder/java
   74  sudo chmod 775 /usr/folder/java
   76  sudo chmod 775 /folder/java
   77  sudo chmod 775 /folder/java
   80  sudo chmod 0777 -R /local/java/
   90  chmod a+x jdk.bin
   99  chmod +x jdk.sh
  103  chmod +x netbeans.sh
  222  chmod o+x /usr/bin/add-apt-repository.sh
  248  sudo chmod +x xampp-linux-x64-1.8.3-2-installer.run
  250  sudo chmod +x xampp-linux-x64-1.8.3-2-installer.run
  251  chmod +x xampp-linux-x64-1.8.3-2-installer.run
  252  sudo chmod +x xampp-linux-x32-1.8.3-2-installer.run
  253  chmod +x xampp-linux-1.8.2-0-installer.run
  256  sudo chmod +x xampp-linux-x64-1.8.3-2-installer.run
  257  sudo chmod +x xampp-linux-x32-1.8.3-2-installer.run
  433  sudo chmod -R 777 /usr
  484  pkexec chmod go-w /usr/lib/sudo/sudoers.so
  487  chmod -R a+rx /etc/sudoers.d
  488  chmod -R u+w /etc/sudoers.d

Yep - There it is: sudo chmod -R 777 /usr
That command added 777 rights to everything under /usr.

At the very least, you should do:
sudo chmod 644 /usr/lib/sudo/sudoers.so

HI
i tried this command in normal mode and recovery mode and i have this error
unable to load plugins

i cannot change the date,the network is disabled i cannot enables it..i cannot start mysql no apache,i cannot install any software from command line etc..

I would backup and reinstall if I were you. Why did you run these chmod -R commands on system files ?

You're not the first one to do such thing, look at this answer.

I always use a separate partition for /home, in case something like this happens.

is there a good software to backup and reinstall without infecting my programs and data...

You can backup your user data with luckybackup, which is a GUI interface to rsync. Boot with a live ubuntu CD, install luckybackup, visit your hard drive with the file manager, plug in an external drive, and define a backup task in luckybackup.

For a faster way, use a tar cpvzf command to create a gunzipped version of your home folder.

Notice that I'm a beginner, as far as backup is concerned :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.