SU not work expected.

When I enter “su” command, password not accepted. Many programs don’t work. I think it is related latest command that I entered. Accidentally, I changed root directory ownership with normal user. Later changed back the ownership with root user. I think the some files in sbin directory must be other ownership and problem is related the ownerships. How can I solve this problem.

I am using
opensuse 13.2 64 bit

What did you do to change ownership? Please the command and fromm which working directory.

And whatt did you do to “repair” the damage" Again, which command and from which working directory.

We can not know thhings you do not tell us.

Working directory /backuphdd that I mounted.
chown -R myusername …
Efected all / directory (usr, bin, sbin …)
After I realized I pressed (ctrl+z keys) and after I entered “chown -R root” command.

Now I can not enter yast with my root password. Also I can’t use “su” command with my root password. I can login into kde with my root password and all of the things works that expected. But when I login with my normal user into kde, some programs (skype, mysql…) don’t work.

On 2015-01-22, fakiradam <fakiradam@no-mx.forums.opensuse.org> wrote:
>
> Working directory /backuphdd that I mounted.
> chown -R myusername …
> Efected all / directory (usr, bin, sbin …)
> After I realized I pressed (ctrl+z keys) and after I entered “chown -R
> root” command.
>
> Now I can not enter yast with my root password. Also I can’t use “su”
> command with my root password. I can login into kde with my root
> password and all of the things works that expected. But when I login
> with my normal user into kde, some programs (skype, mysql…) don’t work.

I’m not sure I understand precisely what you have done, but I guess I’m probably not alone on this. Can we start with
you simply outputting the result of…


sh-4.2$ ls -lrt /

… inside code tags (#)?

What was on the place where you put … ?

BTW you cannot repair like that. Files there are not only owned by root. Thus making them all owned by root does not “repair”. It must be set to the owner that owned it before you did the damage, not allwyas root.

Let me explain my problem clearly:

Logged into KDE with my default user account , when i try to open yast control panel.
And when i wrote my root password , i cant enter to Yast panel. Password not accepted.

Also if i open konsole then when i write su command and insert correct password password not accepted.

But when i try to login as with same root details into kde that’s working correctly and I can open Yast without password. Also i cant start mysql with “service mysql start” command. Other anormalities skype not work, wine not work.

I don’t know if that is related the problem but 2 days ago when I mounted a disk I entered the wrong command into konsole to change user ownerships. I aimed to change user ownership into my normal user account for mounted backup directory.
Working directory : /backupdisc

chown -R ckurdu ..

I accidentally wrote “…” and I realized that and I pressed “ctrl+z” to stop. But I delayed. So I try the command “chown -R root …” to convert into true ownership for root directory.
**After these commands my root directory **

drwxr-xr-x   1 root   root      0 Sep 25 11:12 selinux
drwxr-xr-x   1 root   root      0 Sep 25 11:12 mnt
drwxr-xr-x   1 root   root    130 Oct 26 11:10 usr
drwxr-xr-x   1 root   root    120 Nov 21 18:24 var
drwxr-xr-x   1 root   root     34 Nov 21 18:55 srv
drwxr-xr-x   1 root   root      0 Nov 21 20:38 eski_root
drwxr-xr-x   1 root   root      0 Nov 21 20:43 250gb_linux
drwxr-xr-x   1 root   root      0 Nov 21 20:43 500gb_home
drwxr-xr-x   1 root   root      0 Nov 21 20:43 500gb_root
drwxr-xr-x   1 root   root      0 Nov 21 20:43 eski_home
drwxr-xr-x   1 root   root     10 Dec 20 16:13 .kde4
drwxr-xr-x   1 root   root     62 Dec 23 17:24 opt
drwxr-xr-x   1 root   root   1276 Dec 23 17:52 boot
drwxr-xr-x   1 root   root      0 Jan  4 11:03 vitualbox
drwxr-xr-x   7 ckurdu root   4096 Jan 16 17:40 virtualbox
drwxr-xr-x   1 root   root   2956 Jan 19 11:58 lib
drwxr-xr-x   1 root   root   5272 Jan 19 11:58 lib64
drwxr-xr-x   1 root   root   4756 Jan 19 11:58 sbin
drwxr-xr-x   1 root   root      0 Jan 20 22:10 **backupdisc**
drwxr-x---   1 root   root   3556 Jan 20 22:11 .snapshots
drwxr-xr-x   1 root   root   1742 Jan 22 11:13 bin
drwxr-xr-x   4 ckurdu root     38 Jan 22 14:10 home
dr-xr-xr-x 321 root   root      0 Jan 22 15:08 proc
-rw-r--r--   1 root   root 178673 Jan 22 15:10 .readahead
drwx------   1 root   root    642 Jan 22 15:18 root
dr-xr-xr-x  12 root   root      0 Jan 22 15:19 sys
drwxr-xr-x  19 root   root   4220 Jan 22 16:48 dev
drwxr-xr-x   1 root   root   5538 Jan 22 17:10 etc
drwxr-xr-x  35 root   root    980 Jan 22 17:10 run
drwxrwxrwt   1 root   root   6336 Jan 22 17:15 tmp

Sorry my english. I hope you can understand my problem.

I am inclined to suggest a re-install. Possibly an update-reinstall would be sufficient, though that might not fix all broken permissions.

I think there are several things wrong in your /

E.g. /home should be owned by root, not by some oridinary user.

Why is there a .kde4 there???

You also say you loged in as root. From the context I understand that you did that in the GUI and not in the CLI. When that is true, my advice would be (also because the chwond … you did earlier and because of the strange thinmgs in your /) that you should take security more serious.

Because of your original question about su not working, I would have asked to post the ouput of

ls -l $(which su)

But because you have much more problems then only su and because it will be very difficult to check each and every file in your system (chmod -R / will include every file in your system) I am with nrickert. Save your user data (all in /home and maybe on other places) and do a re-installation.

On 2015-01-22, fakiradam <fakiradam@no-mx.forums.opensuse.org> wrote:
> Code:
> --------------------
> drwxr-xr-x 1 root root 0 Sep 25 11:12 selinux
> drwxr-xr-x 1 root root 0 Sep 25 11:12 mnt
> drwxr-xr-x 1 root root 130 Oct 26 11:10 usr
> drwxr-xr-x 1 root root 120 Nov 21 18:24 var
> drwxr-xr-x 1 root root 34 Nov 21 18:55 srv
> drwxr-xr-x 1 root root 0 Nov 21 20:38 eski_root
> drwxr-xr-x 1 root root 0 Nov 21 20:43 250gb_linux
> drwxr-xr-x 1 root root 0 Nov 21 20:43 500gb_home
> drwxr-xr-x 1 root root 0 Nov 21 20:43 500gb_root
> drwxr-xr-x 1 root root 0 Nov 21 20:43 eski_home
> drwxr-xr-x 1 root root 10 Dec 20 16:13 .kde4
> drwxr-xr-x 1 root root 62 Dec 23 17:24 opt
> drwxr-xr-x 1 root root 1276 Dec 23 17:52 boot
> drwxr-xr-x 1 root root 0 Jan 4 11:03 vitualbox
> drwxr-xr-x 7 ckurdu root 4096 Jan 16 17:40 virtualbox
> drwxr-xr-x 1 root root 2956 Jan 19 11:58 lib
> drwxr-xr-x 1 root root 5272 Jan 19 11:58 lib64
> drwxr-xr-x 1 root root 4756 Jan 19 11:58 sbin
> drwxr-xr-x 1 root root 0 Jan 20 22:10 backupdisc
> drwxr-x— 1 root root 3556 Jan 20 22:11 .snapshots
> drwxr-xr-x 1 root root 1742 Jan 22 11:13 bin
> drwxr-xr-x 4 ckurdu root 38 Jan 22 14:10 home
> dr-xr-xr-x 321 root root 0 Jan 22 15:08 proc
> -rw-r–r-- 1 root root 178673 Jan 22 15:10 .readahead
> drwx------ 1 root root 642 Jan 22 15:18 root
> dr-xr-xr-x 12 root root 0 Jan 22 15:19 sys
> drwxr-xr-x 19 root root 4220 Jan 22 16:48 dev
> drwxr-xr-x 1 root root 5538 Jan 22 17:10 etc
> drwxr-xr-x 35 root root 980 Jan 22 17:10 run
> drwxrwxrwt 1 root root 6336 Jan 22 17:15 tmp
> --------------------

OK. As hcvv has pointed out, you have multiple problems with /. There are many items here which should not be, and your
/home/ ownership is wrong. I guess your compound problems can be corrected using long, slow, and painful procedures but
I’m inclined to agree with nrickert about reinstalling because it would be probably take far less time (<1 hour) then
correcting your problem. Before you think about reinstalling however, here’s some advice:

  1. Backup your data.
  2. Don’t ever chown/chmod the main directories in / (there are only rare exceptions).
  3. Don’t create/put additional main directories in /. Mount points should reside in /mnt/ and VMs in /var/.
  4. Never log into a desktop session as root (again there are only rare exceptions).
  5. When you re-install, I suggest (many would disagree) avoiding BTRFS and partition your hard drive properly.

rpm --setperms and rpm --setugids may fix it as well. It won’t fix mangled user file ownership, but neither reinstallation will.

On 2015-01-22, arvidjaar <arvidjaar@no-mx.forums.opensuse.org> wrote:
> rpm --setperms and rpm --setugids may fix it as well. It won’t fix
> mangled user file ownership, but neither reinstallation will.

Sorry I should have made myself clearer. By `reinstallation’ I meant fresh install.

Thanks to all of you.

I made a reinstallation. Everything is working as expected. I saved my mysql data.

That is fine, congratulations!

Now please think over some of the policies you seem to have in doing things.
. Only use root when needed and never login in the GUI: https://en.opensuse.org/SDB%3ALogin_as_root
. When you want to create mount points for more file systems, either do this on the place that seems to be logical (e.g. a separate file stem for some user’s home directory,kl should of course be mounted on /home/thatuser), or create mountpoints inside /mnt. That is where /mnt is for. See also: https://en.opensuse.org/SDB%3ABasics_of_partitions,_filesystems,_mount_points. You can always use symlinks from other places to the mountpoint to make things easier to use.
. Do not change ownership/permissions of system files from the settings given to them at installation. I most cases you will make things worse and not solve the issue you have and that you think to solve with doing this. Better present the issue here in the forums.