Fórum Ubuntu CZ/SK
Ubuntu pro osobní počítače => Obecná podpora => Téma založeno: abc10 28 Srpna 2009, 11:57:23
-
Ahoj all.
Omylem jsem nastavil:
sudo chmod -R 777 /etc
Myslel jsem, že když to udělám, tak si ulehčím rpáci s ručním nastavováním chmodu 777 ke každé složce kterou upravuju... Když ale chci teď vykonávat nějaké příkazy třeba sudo -i, tak mi to napíše:
sudo: etc/sudoers is mode 0777, should by 0440
Nevíte jak mám nastavit zpět chmod 0440 pro /etc ? Když dám vykonat příkaz sudo chmod -R 444 /etc píče mi to to samé jako u sudo -i :( :( :( :( :(
Poradí někdo? :(
-
OMG !!
Jak toto lze udělat omylem to teda nechápu ::).
Veškerý tyhle změny práv v systému jsou největší kravina ;)
[prema@fedora ~]$ ls -l /etc
celkem 2444
-rw-r--r--. 1 root root 45 28. srp 07.01 adjtime
drwxr-xr-x. 2 root root 4096 11. srp 16.51 akonadi
-rw-r--r--. 1 root root 1512 10. dub 10.42 aliases
-rw-r-----. 1 root smmsp 12288 4. čen 21.50 aliases.db
drwxr-xr-x. 2 root root 4096 11. srp 14.47 alsa
drwxr-xr-x. 2 root root 4096 21. srp 20.21 alternatives
-rw-r--r--. 1 root root 541 29. čec 08.43 anacrontab
-rw-r--r--. 1 root root 245 20. srp 09.22 anthy-conf
-rw-r--r--. 1 root root 148 10. zář 2008 asound.conf
-rw-r--r--. 1 root root 10931 28. srp 07.01 asound.state
-rw-------. 1 root root 1 17. čec 13.37 at.deny
drwxr-x---. 3 root root 4096 11. srp 14.37 audisp
drwxr-x---. 2 root root 4096 11. srp 14.37 audit
drwxr-xr-x. 4 root root 4096 11. srp 14.39 avahi
drwxr-xr-x. 2 root root 4096 23. srp 10.55 bash_completion.d
-rw-r--r--. 1 root root 1892 10. dub 10.42 bashrc
drwxr-xr-x. 2 root root 4096 28. srp 08.33 blkid
drwxr-xr-x. 2 root root 4096 12. srp 10.08 bluetooth
drwxr-xr-x. 2 root root 4096 4. čen 21.50 bonobo-activation
drwxr-xr-x. 4 root root 4096 4. čen 21.50 ConsoleKit
drwxr-xr-x. 2 root root 4096 13. srp 12.07 cron.d
drwxr-xr-x. 2 root root 4096 16. srp 20.06 cron.daily
-rw-r--r--. 1 root root 0 18. čen 13.52 cron.deny
drwxr-xr-x. 2 root root 4096 13. srp 12.07 cron.hourly
drwxr-xr-x. 2 root root 4096 18. čen 10.42 cron.monthly
-rw-r--r--. 1 root root 448 18. čen 10.42 crontab
drwxr-xr-x. 2 root root 4096 18. čen 10.42 cron.weekly
-rw-r--r--. 1 root root 0 11. srp 13.17 crypttab
-rw-r--r--. 1 root root 1453 10. dub 10.42 csh.cshrc
-rw-r--r--. 1 root root 873 10. dub 10.42 csh.login
drwxr-xr-x. 5 root lp 4096 16. srp 20.06 cups
drwxr-xr-x. 4 root root 4096 11. srp 14.38 dbus-1
drwxr-xr-x. 2 root root 4096 13. srp 12.06 default
drwxr-xr-x. 2 root root 4096 4. čen 21.49 depmod.d
drwxr-xr-x. 3 root root 4096 6. srp 23.34 dhcp
-rw-r--r--. 1 root root 178 7. kvě 02.00 dhcp6c.conf
-rw-r--r--. 1 root root 4303 24. úno 2009 DIR_COLORS
-rw-r--r--. 1 root root 4002 19. bře 15.56 DIR_COLORS.lightbgcolor
-rw-r--r--. 1 root root 5342 24. úno 2009 DIR_COLORS.256color
drwxr-xr-x. 2 root root 4096 26. srp 16.28 dirmngr
-rw-r--r--. 1 root root 19253 24. úno 2009 dnsmasq.conf
drwxr-xr-x. 2 root root 4096 24. úno 2009 dnsmasq.d
-rw-rw-r--. 1 root disk 0 22. čen 15.04 dumpdates
-rw-r--r--. 1 root root 4843 24. úno 2009 enscript.cfg
-rw-r--r--. 1 root root 0 10. dub 10.56 environment
drwxr-xr-x. 2 root root 4096 11. srp 15.13 esmska
-rw-r--r--. 1 root root 28 16. čec 10.35 ethers
drwxr-xr-x. 2 root root 4096 12. srp 10.08 event.d
-rw-r--r--. 1 root root 0 10. dub 10.42 exports
lrwxrwxrwx. 1 root root 56 4. čen 21.50 favicon.png -> /usr/share/icons/hicolor/16x16/apps/fedora-logo-icon.png
-rw-r--r--. 1 root root 22060 24. úno 2009 fb.modes
-rw-r--r--. 1 root root 29 12. kvě 00.45 fedora-release
drwxr-xr-x. 2 root root 4096 11. srp 14.42 festival
-rw-r--r--. 1 root root 59 10. dub 10.42 filesystems
drwxr-xr-x. 4 root root 4096 16. srp 20.06 fonts
drwxr-xr-x. 2 root root 4096 26. srp 16.28 foomatic
-rw-r--r--. 1 root root 20 7. kvě 16.32 fprintd.conf
-rw-r--r--. 1 root root 806 11. srp 13.17 fstab
drwxr-xr-x. 7 root root 4096 1. čen 18.04 gconf
drwxr-xr-x. 2 root root 4096 18. čen 23.36 gcrypt
drwxr-xr-x. 6 root root 4096 11. srp 14.42 gdm
drwxr-xr-x. 2 root root 4096 11. srp 16.51 ggz.modules.d
drwxr-xr-x. 3 root root 4096 21. srp 20.22 ghostscript
drwxr-xr-x. 4 root root 4096 29. čen 13.51 gimp
-rw-r--r--. 1 root root 8200 24. úno 2009 gnokiirc
-rw-r--r--. 1 root root 10793 25. úno 2009 gnome-vfs-mime-magic
drwxr-xr-x. 3 root root 4096 4. čen 21.52 gnome-vfs-2.0
drwxr-xr-x. 2 root root 4096 22. čen 19.01 gnupg
-rw-r--r--. 1 root root 1756 14. dub 09.50 gpm-root.conf
-rw-r--r--. 1 root root 1582 14. dub 09.50 gpm-syn.conf
-rw-r--r--. 1 root root 4763 14. dub 09.50 gpm-twiddler.conf
drwxr-xr-x. 2 root root 4096 11. srp 14.40 gre.d
-rw-r--r--. 1 root root 869 11. srp 16.51 group
-rw-r--r--. 1 root root 855 11. srp 16.51 group-
lrwxrwxrwx. 1 root root 22 11. srp 13.17 grub.conf -> ../boot/grub/grub.conf
-r--------. 1 root root 716 11. srp 16.51 gshadow
-r--------. 1 root root 705 11. srp 16.51 gshadow-
-rw-r--r--. 1 root root 801 25. úno 2009 gssapi_mech.conf
drwxr-xr-x. 2 root root 4096 11. srp 15.09 gtk
drwxr-xr-x. 2 root root 4096 4. čen 21.50 gtkmathview
drwxr-xr-x. 3 root root 4096 18. čec 07.43 gtk-2.0
drwxr-xr-x. 3 root root 4096 12. srp 10.59 hal
-rw-r--r--. 1 root root 26 10. dub 10.42 host.conf
-rw-r--r--. 1 root root 83 4. čen 21.54 hosts
-rw-r--r--. 1 root root 370 10. dub 10.42 hosts.allow
-rw-r--r--. 1 root root 645 10. dub 10.42 hosts.deny
drwxr-xr-x. 2 root root 4096 11. srp 16.51 htdig
drwxr-xr-x. 4 root root 4096 4. čen 21.50 httpd
drwxr-xr-x. 2 root root 4096 9. bře 21.04 chkconfig.d
-rw-r--r--. 1 root root 3579 19. kvě 23.37 idmapd.conf
lrwxrwxrwx. 1 root root 11 4. čen 21.49 init.d -> rc.d/init.d
-rw-r--r--. 1 root root 658 1. kvě 22.41 initlog.conf
-rw-r--r--. 1 root root 853 11. srp 13.17 inittab
-rw-r--r--. 1 root root 801 10. dub 10.42 inputrc
drwxr-xr-x. 2 root root 4096 4. čen 21.49 iproute2
drwxr-xr-x. 2 root root 4096 4. čen 21.50 iscsi
-rw-r--r--. 1 root root 54 12. kvě 00.45 issue
-rw-r--r--. 1 root root 53 12. kvě 00.45 issue.net
drwxr-xr-x. 3 root root 4096 4. čen 21.49 java
drwxr-xr-x. 2 root root 4096 31. bře 19.25 jvm
drwxr-xr-x. 2 root root 4096 31. bře 19.25 jvm-commmon
-rw-r--r--. 1 root root 34878 13. bře 09.15 jwhois.conf
drwxr-xr-x. 5 root root 4096 11. srp 15.20 kde
-rw-r--r--. 1 root root 204 8. čec 2008 kderc
drwxr-xr-x. 5 root root 4096 11. srp 15.20 kde4
-rw-r--r--. 1 root root 271 8. čec 2008 kde4rc
drwxr-xr-x. 4 root root 4096 27. čec 17.19 kernel
-rw-r--r--. 1 root root 1085 8. dub 04.43 kerneloops.conf
-rw-r--r--. 1 root root 608 22. led 2007 krb5.conf
-rw-r--r--. 1 root root 1127 16. led 2009 ksysguarddrc
-rw-r--r--. 1 root root 9122 11. srp 13.17 ldap.conf
-rw-r--r--. 1 root root 133775 26. srp 16.30 ld.so.cache
-rw-r--r--. 1 root root 28 4. srp 11.06 ld.so.conf
drwxr-xr-x. 2 root root 4096 27. srp 14.05 ld.so.conf.d
-rw-r--r--. 1 root root 3534 17. úno 2009 lftp.conf
-rw-r-----. 1 root root 191 21. dub 20.47 libaudit.conf
-rw-r--r--. 1 root root 2293 11. srp 13.17 libuser.conf
-rw-r--r--. 1 root root 2246 11. srp 13.21 localtime
-rw-r--r--. 1 root root 1524 11. srp 13.17 login.defs
-rw-r--r--. 1 root root 662 29. srp 2007 logrotate.conf
drwxr-xr-x. 2 root root 4096 26. srp 16.28 logrotate.d
drwxr-xr-x. 4 root root 4096 15. čen 11.26 logwatch
-rw-r--r--. 1 root root 10814 20. úno 2006 ltrace.conf
drwxr-xr-x. 5 root root 4096 11. srp 14.37 lvm
drwxr-xr-x. 2 root root 4096 4. čen 21.50 mail
-rw-r--r--. 1 root root 272 15. pro 2008 mailcap
-rw-r--r--. 1 root root 1909 26. úno 2009 mail.rc
drwxr-xr-x. 2 root root 4096 4. čen 21.51 makedev.d
-rw-r--r--. 1 root root 4940 21. dub 14.55 man.config
drwxr-xr-x. 3 root root 4096 4. čen 21.49 maven
drwxr-xr-x. 4 root root 4096 11. srp 15.06 mc
-rw-r--r--. 1 root root 6 26. úno 2009 mcs-backend
-rw-r--r--. 1 root root 0 11. srp 13.17 mdadm.conf
-rw-r--r--. 1 root root 27552 15. pro 2008 mime.types
-rw-r--r--. 1 root root 1112 30. bře 2003 minicom.users
-rw-r--r--. 1 root root 803 25. srp 2008 mke2fs.conf
-rw-r--r--. 1 root root 0 11. srp 13.17 modprobe.conf
drwxr-xr-x. 2 root root 4096 11. srp 14.37 modprobe.d
-rw-r--r--. 1 root root 0 10. dub 10.42 motd
drwxr-xr-x. 2 root root 4096 13. srp 22.49 mplayer
-rw-r--r--. 1 root root 414 28. srp 08.33 mtab
-rw-r--r--. 1 root root 2620 7. dub 13.16 mtools.conf
-rw-r--r--. 1 root root 2705 7. dub 21.46 multipath.conf
-rw-r--r--. 1 root root 849 11. čec 09.14 my.cnf
-rw-r--r--. 1 root root 768 28. kvě 21.25 netconfig
drwxr-xr-x. 2 root root 4096 11. srp 14.38 netplug
drwxr-xr-x. 2 root root 4096 11. srp 14.38 netplug.d
drwxr-xr-x. 5 root root 4096 11. srp 14.42 NetworkManager
-rw-r--r--. 1 root root 58 1. kvě 22.41 networks
-rw-r--r--. 1 root root 2144 4. srp 13.18 nscd.conf
-rw-r--r--. 1 root root 1728 4. čen 21.51 nsswitch.conf
-rw-r--r--. 1 root root 1696 23. zář 2004 nsswitch.conf.bak
drwxr-xr-x. 3 root root 4096 11. srp 14.37 ntp
-rw-r--r--. 1 root root 1923 29. srp 2008 ntp.conf
drwxr-xr-x. 2 root root 4096 4. čen 21.50 obex-data-server
drwxr-xr-x. 3 root root 4096 9. dub 16.19 openldap
drwxr-xr-x. 2 root root 4096 26. úno 2009 openvpn
drwxr-xr-x. 2 root root 4096 4. bře 14.13 opt
drwxr-xr-x. 2 root root 4096 23. srp 10.55 PackageKit
drwxr-xr-x. 2 root root 4096 27. srp 14.04 pam.d
drwxr-xr-x. 2 root root 4096 4. čen 21.50 pam_pkcs11
-rw-r--r--. 1 root root 12 26. úno 2009 pam_smb.conf
drwxr-xr-x. 3 root root 4096 11. srp 14.37 pango
-rw-r--r--. 1 root root 1868 11. srp 16.51 passwd
-rw-r--r--. 1 root root 1816 11. srp 15.33 passwd-
-rw-r--r--. 1 root root 1362 27. úno 04.23 pbm2ppa.conf
drwxr-xr-x. 2 root root 4096 4. čen 21.51 pcmcia
drwxr-xr-x. 7 root root 4096 4. čen 21.49 pki
drwxr-xr-x. 5 root root 4096 4. čen 21.51 pm
-rw-r--r--. 1 root root 370 24. dub 11.51 pm-utils-hd-apm-restore.conf
-rw-r--r--. 1 root root 6300 27. úno 04.23 pnm2ppa.conf
drwxr-xr-x. 2 root root 4096 4. čen 21.50 PolicyKit
drwxr-xr-x. 2 root root 4096 23. úno 2009 popt.d
drwxr-xr-x. 2 root root 4096 16. srp 20.06 portreserve
drwxr-xr-x. 3 root root 4096 4. čen 21.51 ppp
-rw-r--r--. 1 root root 578982 28. srp 03.47 prelink.cache
-rw-r--r--. 1 root root 789 9. říj 2007 prelink.conf
drwxr-xr-x. 2 root root 4096 19. srp 09.41 prelink.conf.d
-rw-r--r--. 1 root root 135 11. srp 13.19 printcap
-rw-r--r--. 1 root root 1033 10. dub 10.42 profile
drwxr-xr-x. 2 root root 4096 26. srp 16.29 profile.d
-rw-r--r--. 1 root root 6477 10. dub 10.42 protocols
drwxr-xr-x. 2 root root 4096 23. srp 15.04 pulse
drwxr-xr-x. 2 root root 4096 23. srp 10.54 purple
-rw-r--r--. 1 root root 220 13. říj 2008 quotagrpadmins
-rw-r--r--. 1 root root 257 13. říj 2008 quotatab
lrwxrwxrwx. 1 root root 7 4. čen 21.50 rc -> rc.d/rc
drwxr-xr-x. 10 root root 4096 4. čen 21.50 rc.d
lrwxrwxrwx. 1 root root 13 4. čen 21.50 rc.local -> rc.d/rc.local
lrwxrwxrwx. 1 root root 15 4. čen 21.50 rc.sysinit -> rc.d/rc.sysinit
lrwxrwxrwx. 1 root root 10 4. čen 21.50 rc0.d -> rc.d/rc0.d
lrwxrwxrwx. 1 root root 10 4. čen 21.50 rc1.d -> rc.d/rc1.d
lrwxrwxrwx. 1 root root 10 4. čen 21.50 rc2.d -> rc.d/rc2.d
lrwxrwxrwx. 1 root root 10 4. čen 21.50 rc3.d -> rc.d/rc3.d
lrwxrwxrwx. 1 root root 10 4. čen 21.50 rc4.d -> rc.d/rc4.d
lrwxrwxrwx. 1 root root 10 4. čen 21.50 rc5.d -> rc.d/rc5.d
lrwxrwxrwx. 1 root root 10 4. čen 21.50 rc6.d -> rc.d/rc6.d
-rw-r--r--. 1 root root 1053 5. bře 19.14 readahead.conf
-rw-r--r--. 1 root root 435 28. srp 08.32 reader.conf
drwxr-xr-x. 2 root root 4096 11. srp 15.35 reader.conf.d
lrwxrwxrwx. 1 root root 14 4. čen 21.49 redhat-release -> fedora-release
-rw-r--r--. 1 root root 91 28. srp 08.33 resolv.conf
lrwxrwxrwx. 1 root root 11 11. srp 14.37 rmt -> ../sbin/rmt
-rw-r--r--. 1 root root 1615 4. srp 10.58 rpc
drwxr-xr-x. 2 root root 4096 21. srp 20.21 rpm
-rw-r--r--. 1 root root 2741 14. čec 2008 rsyslog.conf
-rw-r--r--. 1 root root 831 1. kvě 22.41 rwtab
drwxr-xr-x. 2 root root 4096 1. kvě 22.41 rwtab.d
drwxr-xr-x. 2 root root 4096 4. čen 21.51 samba
drwxr-xr-x. 3 root root 4096 11. srp 14.51 sane.d
drwxr-xr-x. 2 root root 4096 24. úno 2009 sasl2
-rw-r--r--. 1 root root 666 30. čen 13.50 scsi_id.config
-rw-------. 1 root root 122 10. dub 10.42 securetty
drwxr-xr-x. 6 root root 4096 4. čen 21.51 security
drwxr-xr-x. 3 root root 4096 14. srp 09.06 selinux
-rw-r--r--. 1 root root 6845 8. bře 11.51 sensors3.conf
-rw-r--r--. 1 root root 630983 10. dub 10.42 services
-rw-r--r--. 1 root root 216 26. čen 20.50 sestatus.conf
drwxr-xr-x. 2 root root 4096 11. srp 14.48 setroubleshoot
drwxr-xr-x. 2 root root 4096 21. srp 20.22 setuptool.d
drwxr-xr-x. 3 root root 4096 11. srp 15.33 sgml
-r--------. 1 root root 1130 11. srp 16.51 shadow
-r--------. 1 root root 1109 11. srp 15.33 shadow-
-rw-r--r--. 1 root root 32 10. dub 10.42 shells
drwxr-xr-x. 4 root root 4096 11. srp 14.36 skel
-rw-r--r--. 1 root root 9053 26. úno 2009 slp.conf
-rw-r--r--. 1 root root 6463 12. dub 04.04 smartd.conf
drwxr-xr-x. 2 root root 4096 4. čen 21.51 smolt
drwxr-xr-x. 2 root root 4096 26. úno 2009 smrsh
-rw-r--r--. 1 root root 238 22. čen 20.26 sos.conf
drwxr-xr-x. 3 root root 4096 4. čen 21.52 sound
drwxr-xr-x. 2 root root 4096 4. čen 21.51 ssh
-rw-r--r--. 1 root root 212 1. kvě 22.41 statetab
drwxr-xr-x. 2 root root 4096 1. kvě 22.41 statetab.d
drwxr-xr-x. 2 root root 4096 26. úno 2009 stunnel
drwxr-xr-x. 2 root root 4096 7. srp 09.46 subversion
-r--r-----. 1 root root 3161 5. kvě 2008 sudoers
drwxr-xr-x. 7 root root 4096 27. srp 14.04 sysconfig
-rw-r--r--. 1 root root 604 1. kvě 22.41 sysctl.conf
lrwxrwxrwx. 1 root root 14 4. čen 21.49 system-release -> fedora-release
-rw-r--r--. 1 root root 31 12. kvě 00.45 system-release-cpe
drwxr-xr-x. 2 root root 4096 26. úno 2009 terminfo
-rw-r--r--. 1 root root 45 13. bře 2008 Trolltech.conf
drwxr-xr-x. 4 root root 4096 11. srp 14.37 udev
-rw-r--r--. 1 root root 191 28. lis 2008 updatedb.conf
drwxr-xr-x. 2 root root 4096 17. srp 11.49 vbox
-rw-r--r--. 1 root root 1962 3. čen 2008 virc
drwxr-xr-x. 2 root root 4096 4. čen 21.49 vpnc
-rw-r--r--. 1 root root 3001 13. bře 14.34 warnquota.conf
drwxr-xr-x. 2 root root 4096 11. srp 14.42 wpa_supplicant
-rw-r--r--. 1 root root 0 25. úno 2009 wvdial.conf
drwxr-xr-x. 2 root root 4096 11. srp 15.33 w3m
drwxr-xr-x. 4 root root 4096 4. čen 21.50 xdg
drwxr-xr-x. 2 root root 4096 11. srp 15.33 xinetd.d
drwxr-xr-x. 2 root root 4096 4. čen 21.49 xml
drwxr-xr-x. 2 root root 4096 11. srp 16.51 xscreensaver
drwxr-xr-x. 6 root root 4096 11. srp 16.51 X11
-rw-r--r--. 1 root root 585 21. kvě 13.32 yp.conf
drwxr-xr-x. 3 root root 4096 21. kvě 00.29 yum
-rw-r--r--. 1 root root 791 21. kvě 00.29 yum.conf
-rw-------. 1 root root 247 25. úno 2009 yumex.conf
-rw-r--r--. 1 root root 32 25. úno 2009 yumex.profiles.conf
drwxr-xr-x. 2 root root 4096 21. srp 13.57 yum.repos.d
Navíc jak vidíš, tak všechno nemá stejný práva, takže žádnej jednoduchej způsob jak tohle nastavit zpátky není, jedině nová instalace, takže bych to zkusil nastavit na ty práva, který tam jsou nejčastěj a doufat, že to bude fungovat.
-
Zkus ty sudoers opravit v recovery mode, tam by to nemělo dělat problém.
Až to budeš mít hotové, nastav si restriktivnější práva třeba podle toho výpisu Premeta. Myslím, že důležité soubory jsou hlavně-rw-r--r-- - fstab
-rw-r--r-- - group
-rw-r----- - gshadow
-rw-r--r-- - mtab
-rw-r--r-- - passwd
-rw-r----- - shadow
-r--r----- - sudoersale co mám zkušenosti, tak citlivý na práva je i cron, init.d atd., takže Tě asi čeká ještě hodně zábavy :)
-
Díky. Už jsem reinstaloval a všechno znova nastavil. Všechno už funkuje jak má :)