Stop killing your production sessions when you misclick

Environment & Shell Customization (Aliases/Functions/.Bashrc)

Stop killing your production sessions when you misclick

🧩 The Challenge

We have all done it. You meant to type exit to close a single tab but hit Ctrl-D in your main production jump host and suddenly your entire SSH session dies along with the five-window multiplexer you spent an hour setting up.

💡 The Fix

Disable the Ctrl-D shortcut in your shell settings so you are forced to actually type the word exit before the session drops. It’s a lifesaver when your fingers are moving faster than your brain.

set -o ignoreeof

⚙️ Why It Works

Setting this shell option tells Bash to ignore the EOF signal, which is what triggers when you hit the end-of-file key combination. You’ll have to either type exit or hit Ctrl-D ten times in a row if you really want to force the close.

🚀 Pro-Tip: Put this in your .bashrc file for every server you manage, because muscle memory is a cruel mistress.

Linux Tips & Tricks | © ngelinux.com | 9/1/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted