82
17
How do you disable scary terminal commands?
I was using SSH to access a remote Ubuntu server without access to the physical server. I thought I was typing 'shutdown
' into the NoSQL server running on the Ubuntu OS, but actually I told the Ubuntu server to shutdown. Then I had to tell the server admin what I did so that he could start up the physical server for me. That was embarrassing!
How can I keep this from happening again?
100This has been discussed in lengths, usually with relation to
rm
which has worse side effects thanshutdown
. Bottom line: here is no way to prevent bad things from happening if you keep running random commands as root. – Dmitry Grigoryev – 2017-06-19T10:17:45.7505As other people have noted regarding aliasing, doing so can make people "get in the habit of a command working in a non-standard way." So does it seem bad to anyone else that the silly NoSQL server uses this command? – bmb – 2017-06-19T23:08:19.083
The NoSQL server that I was using is Redis. – MelodiousFires – 2017-06-19T23:25:20.060
60Just do not work under the root account. – alk – 2017-06-20T08:38:57.453
12I dare say you learnt the lesson so won't have to feel the need to disable any command again. I'd also add you don't fool-proof GNU/Linux, you just get better than the fool. – None – 2017-06-20T14:13:24.477
permissions ......... – user428517 – 2017-06-20T21:13:33.150
Not working under root account only works if the passwords are different on different servers. If different servers all have the same passwords, then the wrong system can still be shutdown. – jmort253 – 2017-06-22T13:12:18.577
Ever thought about just... Not executing them? – William Edwards – 2017-06-24T07:38:36.163