Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: help for permission "/etc"?

  1. #1
    Join Date
    Apr 2015
    Location
    The Earth
    Posts
    498

    Default help for permission "/etc"?

    Hi
    i change permission folder /etc but not work my system and not work command sudo
    how to set default permission for folder /etc/
    when use command sudo
    show this error
    Code:
     sudo
    sudo: /etc/sudoers is world writable
    sudo: no valid sudoers sources found, quitting
    sudo: unable to initialize policy plugin
    Thanks
    Dual-boot openSUSE and win10
    OpenSUSE Tumbleweed ; Plasma 5.15.x:" LVM encrypted"
    My Partition: GPT and UEFI system
    Hp ProBook 450 G1

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,742

    Default Re: help for permission "/etc"?

    Are you sure you only changed the permission for the directory /etc?
    Or did you change permission for several/all files in /etc also?

    And you could at least post some facts with your story, like
    Code:
    ls -ld /etc
    so we can see what the permissions are now.

    BTW the permission (and ownership) of the directory /etc should be:
    Code:
    henk@boven:~> ls -ld /etc
    drwxr-xr-x 124 root root 12288 27 jan 23:30 /etc
    henk@boven:~>
    Henk van Velden

  3. #3
    Join Date
    Apr 2015
    Location
    The Earth
    Posts
    498

    Default Re: help for permission "/etc"?

    Quote Originally Posted by hcvv View Post
    Are you sure you only changed the permission for the directory /etc?
    Or did you change permission for several/all files in /etc also?

    And you could at least post some facts with your story, like
    Code:
    ls -ld /etc
    so we can see what the permissions are now.

    BTW the permission (and ownership) of the directory /etc should be:
    Code:
    henk@boven:~> ls -ld /etc
    drwxr-xr-x 124 root root 12288 27 jan 23:30 /etc
    henk@boven:~>
    I change permission for several/all files in /etc also.(with dophin root)
    and cahange my home folder and sub folders to chmod 700
    Code:
    n4xz:~> ls -ld /etc
    drwxr-xr-x+ 134 root root 12288 Jan 28 20:43 /etc
    Code:
    >ls -ld /home/my home/
    drwxrwx---+ 52 my home root 4096 Jan 28 20:41 /home/my home/
    how to fix ?
    Dual-boot openSUSE and win10
    OpenSUSE Tumbleweed ; Plasma 5.15.x:" LVM encrypted"
    My Partition: GPT and UEFI system
    Hp ProBook 450 G1

  4. #4
    Join Date
    Apr 2015
    Location
    The Earth
    Posts
    498

    Default Re: help for permission "/etc"?

    after change permissions
    I use this commands
    pkexec chmod 555 /etc/sudoers
    pkexec chmod 555 /etc/sudoers.d/README
    sudo chmod 440 /etc/sudoers
    Dual-boot openSUSE and win10
    OpenSUSE Tumbleweed ; Plasma 5.15.x:" LVM encrypted"
    My Partition: GPT and UEFI system
    Hp ProBook 450 G1

  5. #5
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,277

    Default Re: help for permission "/etc"?

    Code:
     # chkstat --system --warn
    and if happy
    Code:
     # chkstat --system --set /etc/
    also
    Code:
     > chkstat --help
    --
    slàinte mhath,
    rayH

    ~ knowing the right answer is easier than knowing the right question.

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,742

    Default Re: help for permission "/etc"?

    Very confusing. But when you changed permission on "several/all files in /etc", then you have borked your system considerable. I have no idea why you did that, but in my opinion, whoever told you to do this was giving very bad advice.

    This is also not easy to repair, but if I ma correct, there is some tool that sets them to what they should be by consulting the RPMs from which they were installed. Maybe somebody knows more.

    BTW
    Code:
    drwxrwx---+ 52 my home root 4096 Jan 28 20:41 /home/my home/
    looks also challenging to me. A user name with a blank space in it is not something I would prefer. Also a normal user should not be a member of the root group.

    In other words it looks as if you have a very customized system where not many will feel enough at home to be able to help you efficiently .

    Edit: I see that eng-int knows the tool.
    Last edited by hcvv; 28-Jan-2018 at 11:59.
    Henk van Velden

  7. #7
    Join Date
    Apr 2015
    Location
    The Earth
    Posts
    498

    Default Re: help for permission "/etc"?

    Quote Originally Posted by eng-int View Post
    Code:
     # chkstat --system --warn
    and if happy
    Code:
     # chkstat --system --set /etc/
    also
    Code:
     > chkstat --help
    after change permission not booting my opensuse
    i use live cd and change permission chmod -R 777 /etc/* , then my opensuse is boot compleat
    now work my system but i think not complete workings

    chkstat --system --warn
    Code:
     # chkstat --system --warn
    Checking permissions and ownerships - using the permissions files
            /etc/permissions
            /etc/permissions.easy
            /etc/permissions.d/postfix
            /etc/permissions.local
    /var/cache/man/ should be man:root 0755. (wrong owner/group man:man)
    /var/log/lastlog should be root:root 0644. (wrong owner/group root:utmp permissions 0664)
    /var/log/btmp should be root:root 0600. (wrong owner/group root:utmp)
    /etc/passwd should be root:root 0644. (wrong permissions 0777)
    /etc/shadow should be root:shadow 0640. (wrong permissions 0777)
    /etc/init.d/ should be root:root 0755. (wrong permissions 0777)
    /etc/hosts should be root:root 0644. (wrong permissions 0777)
    /etc/hosts.allow should be root:root 0644. (wrong permissions 0777)
    /etc/hosts.deny should be root:root 0644. (wrong permissions 0777)
    /etc/hosts.equiv should be root:root 0644. (wrong permissions 0777)
    /etc/hosts.lpd should be root:root 0644. (wrong permissions 0777)
    /etc/ld.so.conf should be root:root 0644. (wrong permissions 0777)
    /etc/ld.so.cache should be root:root 0644. (wrong permissions 0777)
    /etc/ppp/ should be root:root 0750. (wrong permissions 0777)
    /etc/ppp/chap-secrets should be root:root 0600. (wrong permissions 0777)
    /etc/ppp/pap-secrets should be root:root 0600. (wrong permissions 0777)
    /etc/sysconfig/network/providers/ should be root:root 0700. (wrong permissions 0777)
    /etc/ssh/ssh_config should be root:root 0644. (wrong permissions 0777)
    /etc/ssh/sshd_config should be root:root 0640. (wrong permissions 0777)
    /etc/crontab should be root:root 0600. (wrong permissions 0777)
    /etc/exports should be root:root 0644. (wrong permissions 0777)
    /etc/fstab should be root:root 0644. (wrong permissions 0777)
    /etc/ftpusers should be root:root 0644. (wrong permissions 0777)
    /usr/bin/at: unknown group trusted
    /usr/bin/crontab: unknown group trusted
    /usr/bin/fusermount: unknown group trusted
    /sbin/pccardctl: unknown group trusted
    /usr/sbin/mgnokiidev: unknown group uucp
    /etc/postfix/sasl_passwd should be root:root 0600. (wrong permissions 0777)
    if I will fix all the above errors,change all permissions wrongs,
    Is my system correct?
    Dual-boot openSUSE and win10
    OpenSUSE Tumbleweed ; Plasma 5.15.x:" LVM encrypted"
    My Partition: GPT and UEFI system
    Hp ProBook 450 G1

  8. #8
    Join Date
    Apr 2015
    Location
    The Earth
    Posts
    498

    Default Re: help for permission "/etc"?

    Quote Originally Posted by hcvv View Post
    Very confusing. But when you changed permission on "several/all files in /etc", then you have borked your system considerable. I have no idea why you did that, but in my opinion, whoever told you to do this was giving very bad advice.

    This is also not easy to repair, but if I ma correct, there is some tool that sets them to what they should be by consulting the RPMs from which they were installed. Maybe somebody knows more.

    BTW
    Code:
    drwxrwx---+ 52 my home root 4096 Jan 28 20:41 /home/my home/
    looks also challenging to me. A user name with a blank space in it is not something I would prefer. Also a normal user should not be a member of the root group.

    In other words it looks as if you have a very customized system where not many will feel enough at home to be able to help you efficiently .

    Edit: I see that eng-int knows the tool.
    Thanks for reply
    i dont use space name home folder, sorry that's fake name for here
    Dual-boot openSUSE and win10
    OpenSUSE Tumbleweed ; Plasma 5.15.x:" LVM encrypted"
    My Partition: GPT and UEFI system
    Hp ProBook 450 G1

  9. #9
    Join Date
    Apr 2015
    Location
    The Earth
    Posts
    498

    Default Re: help for permission "/etc"?

    for learning
    how to change permissions this command (for example)
    Code:
    /etc/init.d/ should be root:root 0755. (wrong permissions 0777)
    sudo chmod 755 /etc/init.d/ (true or false)
    Dual-boot openSUSE and win10
    OpenSUSE Tumbleweed ; Plasma 5.15.x:" LVM encrypted"
    My Partition: GPT and UEFI system
    Hp ProBook 450 G1

  10. #10
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,277

    Default Re: help for permission "/etc"?

    Quote Originally Posted by 123thinksuse View Post
    if I will fix all the above errors,change all permissions wrongs,
    Is my system correct?
    If you run this command as root:
    Code:
     # chkstat --system --set
    You will have a set of sensible file permissions according to your chosen security level. Did you read the output of:
    Code:
     > chkstat --help
    Only you will know if that is what you want. The chkstat command will not restore the deleted groups “uucp” and “trusted”.
    --
    slàinte mhath,
    rayH

    ~ knowing the right answer is easier than knowing the right question.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •