After editing `/etc/sudoers` with a text editor, every `sudo` command fails with `sudo: parse error in /etc/sudoers near line 31` and nobody can become root.
IntermediateTroubleshootingSSH, sudo and authentication
Answer
Likely causes → Syntax error in sudoers; sudo refuses to run with a broken policy.
Diagnose →
pkexec visudo -c 2>/dev/null # if polkit is available
Fix → Use pkexec visudo if polkit works; otherwise log in as root on the console, or reboot into rescue mode (rd.break / init=/bin/bash), remount rw and fix the line with visudo -c -f /sysroot/etc/sudoers.
Prevent → Only edit with visudo (it validates), and use drop-ins in /etc/sudoers.d/ deployed with validation.
More on SSH, sudo and authentication
`ssh deploy@server01` fails with `deploy@server01: Permission denied (publickey).`BeginnerPermissions on `~/.ssh` are correct, but you still get `Permission denied (publickey)` and the server log says `Authentication refused: bad ownership or modes for directory /home/deploy`.IntermediateKey auth fails only on RHEL with SELinux enforcing; the server logs show nothing unusual about modes.IntermediateAfter upgrading the client to a new OpenSSH, connections to an old appliance fail with `no matching host key type found. Their offer: ssh-rsa,ssh-dss`.IntermediateA user's RSA key stopped working against a new server: the server log says `userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms`.IntermediateSSH login takes 20–30 seconds before the password or key prompt appears.Intermediate