• We had to restore from a backup today after a failed software update. Backup was from 0000 EDT and restored it at 0800 EDT so we lost about 8hrs. Today is 07/20/2024. More info here.

Today's article is a bit more complicated - and has you disabling specific terminal commands...

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
12,057
Reaction score
10,689
Credits
99,543
This one has quite a bit to it. I've been wanting to actually talk about aliases for a while, but it's a longer article than normal and a bit advanced for the newer users (though it was something I latched onto early). I proofed it a couple of times, hoping that I got all the necessary stuff out there. It ended up pretty long.


Enjoy!
 


This one has quite a bit to it. I've been wanting to actually talk about aliases for a while, but it's a longer article than normal and a bit advanced for the newer users (though it was something I latched onto early). I proofed it a couple of times, hoping that I got all the necessary stuff out there. It ended up pretty long.


Enjoy!
Aliasing a command to an empty string won’t prevent a user from running the command. They can simply escape the alias using a backslash!

Running with your uptime example:
Even if you aliased uptime to echo a fake error message, like "bash: uptime: command not found", to try to fool people. My first port of call would be to try which uptime, to check if it was installed or not.
And if it was, I’d see something like /usr/bin/uptime, which would immediately make me suspicious. Then I’d use the command type uptime, which would tell me that uptime had been aliased to an echo command, which prints a fake error message from bash.

So then I’d run \uptime, in order to bypass/escape the alias and run the actual uptime command.
So aliasing is NOT a way to disable commands!
 
Last edited:
Darn it... I'd forgotten the backslash!

Good call - and will amend the article when I get a minute. (I'll change the verbiage to something about hiding the command and making it more difficult.)

I had completely forgotten the backslash.
 

Staff online

Members online


Latest posts

Top