Access and software consistency
Restore SSH access without widening it, and keep installed software the same across a fleet.
Access is a chain
An SSH login passes through several independent checks, and any one can refuse:
- Network: can the client reach port 22, or a firewall or VPN in between?
- Server policy:
AllowUsers,AllowGroups,DenyGroups, andPermitRootLoginin the effective configuration.sshd -Tprints it after includes andMatchblocks. - Account: does the account exist, and is it locked or expired, with a valid shell?
- Key: is the public key in
~/.ssh/authorized_keys, and is the client offering the matching private key? - File safety: with
StrictModeson (the default), sshd ignores key files that others could modify, including through a group- or world-writable home or.ssh.
Work the chain with evidence from both ends. ssh -v shows what the client offered and where it stopped. The server's auth log (journalctl -u ssh or -u sshd) usually states the reason plainly, for example "User sal from 10.0.4.7 not allowed because none of user's groups are listed in AllowGroups".
Groups change at login
Group membership is copied into a process when the session starts. Adding someone to a group changes the directory, but their open shells keep the old list. id shows the session's groups. This also matters for server policy. After a directory migration renames a group, every rule that names the old group, in sshd_config, in sudoers, or in file ownership, silently stops matching.
When access breaks after a migration, the fix is to update the rule to the new group, not to add individual users. Granting to roles keeps the next review short and the next revocation complete.
Shared accounts and privilege
The handbook argues for individual accounts with sudo over shared logins. Individual accounts give you accountability, because logs name a person, and clean revocation, because removing one person does not rotate everyone's password. Grant sudo for specific commands where possible, to groups rather than people, and log it.
Software is part of the host's state
Package managers keep a database of what is installed and from which repository. The questions to ask during "one host behaves differently":
apt-cache policy label-renderer # installed, candidate, and which repo provides each
dpkg -l label-renderer
dnf list --showduplicates label-renderer
rpm -q --last | head # recently changed packages
Drift creeps in through manual installs, uneven upgrade timing, a node pointing at a different mirror, or a pin applied on some hosts only. The remedy is to declare the version you want and apply it everywhere, which the Infrastructure as Code track's configuration management notes covers. Do that rather than hand-fixing the odd node.
Upgrade, pin, or roll back
When versions differ, decide deliberately. Roll back the odd node when the new version is the regression and you need service now. Pin (apt-mark hold, DNF versionlock) when a known-good version must stay until the incompatibility is fixed, and record why and until when. Upgrade the rest when the new version is correct and the odd node was simply early. In all cases, verify behaviour on each node, not just the version string.
Key terms
- authorized_keys
- Per-user file listing public keys allowed to log in. sshd ignores it if the file or its parent directories are writable by others.
- AllowGroups
- An sshd directive that restricts logins to members of the named groups. Anyone not in a listed group is refused even with a valid key.
- Version pinning
- Holding a package at a chosen version so routine upgrades do not change it (
apt-mark hold, DNF versionlock). - Drift
- Hosts that should be identical diverging over time, through manual changes or uneven upgrades.
Read further
- UNIX and Linux System Administration Handbook, 5th edition, Ch. 8, "User Management", and Ch. 3, "Access Control and Rootly Powers" (Purchase)
How accounts and groups are stored, howsudois configured, and the argument for least privilege. Note how the book recommends handling shared accounts. - UNIX and Linux System Administration Handbook, 5th edition, Ch. 6, "Software Installation and Management" (Purchase)
Package managers (APT and DNF/YUM), repositories and their trust, querying installed versions, and the section on keeping systems consistent. - UNIX and Linux System Administration Handbook, 5th edition, Ch. 27, "Security" (Purchase)
The SSH section, especially key-based authentication, the server configuration directives that restrict who may log in, and the guidance on root login.