Bonjour a tous,
j'ai effectué cette commande
sudo chmod -R 777 /etc
et après je ne peux plus faire aucune commande sudo sachant que j'étais connecté en tant que: ubuntu@monVPS$
chaque commande sudo me donne les messages d'erreur suivants:
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
j'ai cherché et tout essayer mais rien ne marche!
maintenant j'ai redémarré le serveur en mode rescue et j'ai monté la partition mais je n'ai pas su quoi faire pour résoudre le probleme et annuler 777.
je vous pris de m'aider , je suis vraiment bloqué.
j'ai essayé ces commande:
[RESCUE] root@vps-xxxxxxxx:~ $chmod 775 -R /etc/sudoers
[RESCUE] root@vps-xxxxxxxx:~ $ chmod 775 -R /etc/sudoers.d/
[RESCUE] root@vps-xxxxxxxx:~ $ chmod 775 -R /etc
mais rien
Serveurs Privés Virtuels (VPS) - Comment annuler chmod -R 777 /etc
Related questions
- Perte de mot de passe
48477
26.05.2023 13:36
- Comment configurer/utiliser un SMTP depuis un VPS ?
47153
07.10.2019 10:49
- Je connais que le mutu et besoin de node js
46722
14.04.2017 13:34
- Qu'est-ce vcore?
45669
06.01.2017 19:20
- Envoi Email via SMTP (port 587) sur VPS Pro1
44735
27.01.2017 10:02
- [résolu] Serveur Mysql - hôte inconnu
42347
19.01.2017 16:21
- Mon VPS à Timed Out
42028
15.03.2017 22:50
- Délai de livraison VPS
41779
11.07.2018 15:15
- Problème avec statisitique Plesk
39195
29.03.2017 07:44
- Accès externe base de données
38733
18.07.2018 10:29
Ceci n'existe pas.
Sur une erreur pareille, tu risques de devoir réinstaller ton VPS.
Si le contenu est important, tu peux toujours tenter ceci:
louer un 2è VPS,
installer les mêmes packages
sur le VPS en rescue:
mettre tous les fichiers en 644 et les répertoires en 755,
cloner les permissions du nouveau VPS vers celui qui est planté.
(il faut écrire ou trouver un script qui fait ça)
Si tu n'as pas envie de louer un 2è VPS tu peux toujours installer un Linux chez toi sous Virtualbox par exemple.
Sur un debian voici une liste de fichiers/répertoires qui divergent du 644/755 , cette liste n'a aucune prétention d'être exhaustive.
-rw-r----- 1 root daemon 144 Jul 24 2018 at.deny
-rw-r----- 1 root shadow 865 Jun 26 19:51 gshadow
-rw-r----- 1 root shadow 852 Jun 26 19:51 gshadow-
-rw-r----- 1 root nslcd 820 Jan 25 12:21 nslcd.conf
-rw------- 1 root root 32 May 11 2020 postsrsd.secret
-rwxr-xr-x 1 root root 163 Dec 13 2019 qemu-ifdown
-rwxr-xr-x 1 root root 1148 Jan 30 2020 qemu-ifup
-rw-r----- 1 root shadow 1427 Jan 23 22:04 shadow
-rw-r----- 1 root shadow 1395 Jan 23 21:25 shadow-
-rw------- 1 root root 0 Dec 10 2019 subgid-
-rw------- 1 root root 0 Dec 10 2019 subuid-
-r--r----- 1 root root 669 Jan 31 2020 sudoers
./grub.d:
total 80
-rwxr-xr-x 1 root root 9783 Jun 12 2019 00_header
-rwxr-xr-x 1 root root 6258 Jun 12 2019 05_debian_theme
-rwxr-xr-x 1 root root 12444 Jul 30 2020 10_linux
-rwxr-xr-x 1 root root 11497 Jul 30 2020 20_linux_xen
-rwxr-xr-x 1 root root 12059 Jun 12 2019 30_os-prober
-rwxr-xr-x 1 root root 1418 Jun 12 2019 30_uefi-firmware
-rwxr-xr-x 1 root root 214 Jun 12 2019 40_custom
-rwxr-xr-x 1 root root 216 Jun 12 2019 41_custom
./init.d:
total 264
-rwxr-xr-x 1 root root 1071 Jul 24 2018 atd
-rwxr-xr-x 1 root root 2401 Jan 23 2017 avahi-daemon
etc etc...
./kernel/postinst.d:
total 16
-rwxr-xr-x 1 root root 2903 Sep 13 2017 apt-auto-removal
-rwxr-xr-x 1 root root 893 Feb 6 2019 initramfs-tools
-rwxr-xr-x 1 root root 364 Jun 8 2019 unattended-upgrades
-rwxr-xr-x 1 root root 646 Jun 12 2019 zz-update-grub
./kernel/postrm.d:
total 8
-rwxr-xr-x 1 root root 846 Feb 6 2019 initramfs-tools
-rwxr-xr-x 1 root root 646 Jun 12 2019 zz-update-grub
./mysql:
total 24
-rw------- 1 root root 277 May 11 2020 debian.cnf
-rwxr-xr-x 1 root root 1620 Oct 12 2020 debian-start
./network/if-down.d:
total 8
-rwxr-xr-x 1 root root 800 Oct 1 2019 postfix
-rwxr-xr-x 1 root root 256 Apr 1 2016 resolvconf
./network/if-post-down.d:
total 4
-rwxr-xr-x 1 root root 1433 Feb 4 2019 vlan
./network/if-pre-up.d:
total 12
-rwxr-xr-x 1 root root 344 Jun 30 2016 ethtool
-rwxr-xr-x 1 root root 4224 Feb 21 2019 vlan
./network/if-up.d:
total 20
-rwxr-xr-x 1 root root 817 Apr 1 2016 000resolvconf
-rwxr-xr-x 1 root root 1685 Jun 30 2016 ethtool
-rwxr-xr-x 1 root root 677 Feb 4 2019 ip
-rwxr-xr-x 1 root root 1819 Mar 8 2018 nslcd
-rwxr-xr-x 1 root root 1117 Oct 1 2019 postfix
./ssh:
total 612
-rw------- 1 root root 668 Mar 22 2020 ssh_host_dsa_key
-rw------- 1 root root 227 Mar 22 2020 ssh_host_ecdsa_key
-rw------- 1 root root 411 Mar 22 2020 ssh_host_ed25519_key
-rw------- 1 root root 536 Mar 22 2020 ssh_host_key
-rw------- 1 root root 1679 Mar 22 2020 ssh_host_rsa_key
./ssl:
total 36
drwx--x--- 2 root ssl-cert 4096 May 11 2020 private
Bonjour,
le mieux est de partir sur une réinstallation et de garder la règle N°1 en tête : jamais de CHMOD 777.
Cordialement, janus57