Chapter 32. Don’t SSH into Production
Fernando Duran
Routine server system administration tasks should be handled with automation and services, through code and software. Not logging in to system consoles for manual routine maintenance can be seen as an indicator of capability maturity.
Logins to critical servers via SSH should be audited to determine who accessed the servers and what they did. Auditing can get complex when accessing servers via SSH is the standard policy and when considering cases like SSH forwarding and tunneling.
As a test, before logging in to a server to carry out a task, ask yourself the following:
-
Was this task tested first in a dev/QA/test environment?
-
Is this a one-off task (versus a routine task or request)?
If you answer no to either question, you should reconsider your workflow and think of ways to automate away the kind of work you SSH for.
Let’s review some common reasons a cloud engineer would want to log in to a server:
-
To examine logs, like application, container, or operating system logs. This is a solved problem. Using a stack like Elasticsearch, Fluentd, and Kibana, or a third-party logging service in the cloud, will provide log aggregation, search, visualization, and permanent storage capabilities, with a proper life cycle and backups.
-
For monitoring, to look at server telemetry like CPU/RAM/disk ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access