View Source restrict_remsh_mod (util v1.1.5)
Sample restricted remote shell module disabling q/0
and init:stop/{0,1}
commands. The shell introduces a replacement command to stop remote node: remote:stop/1
equivalent to init:stop/1
.
To activate restricted shell, run the server node like this: erl -sname node@host +Bi -shell restricted_shell restrict_remsh_mod
Then you can connect to it with: erl -sname a@myhost -remsh node@host
Link to this section Summary
Functions
Replaces
init:stop/1
with remote:stop/1
to avoid accidental exit of remote shell.Link to this section Types
-type funspec() :: {Mod :: atom(), Fun :: atom()}.
Link to this section Functions
-spec remote_node_stop(Status :: integer()) -> ok.
init:stop/1
with remote:stop/1
to avoid accidental exit of remote shell.