An error is intentionally generated as a test item for macros that log in to the server and get logs.
I want to restrict a directory from being made the current directory with the cd command.

Error message
Error message


Applicable source code

chattr + i/test1/test2
chmod -rwx/test1/test2

Everything will be successful.

Is it possible to restrict the cd command?
Also, please tell me if there are any other good error generation methods.

  • Answer # 1

    If youcdto a non-existent directory, an error will occur.
    Tocdan existing directory and make an error, drop the execution permission of the parent directory.