Debian 的受限 shell

Debian 的受限 shell

我正在研究 Debian 的受限 shell 选项。这个想法是为特定用户提供一个具有有限访问权限和命令的 shell。用户将登录到此 shell 并对文件夹/二进制文件具有有限的访问权限(可见性)。

我已经调查过rbash(容易绕过)和外壳(已弃用)。我也尝试过 chroot jail,但它不是理想的解决方案。

有人知道其他解决方案吗?

答案1

来自维基。

The restricted mode of the Bourne shell sh, and its POSIX workalikes, is used when the interpreter is invoked in one of the following ways:

sh -r    note that this conflicts with the "read" option in some sh variants
rsh    note that this may conflict with the remote shell command, which is also called rsh on some systems
The restricted mode of Bash is used when Bash is invoked in one of the following ways:

rbash
bash -r
bash --restricted

Similarly KornShell's restricted mode is produced by invoking it thus:

rksh
ksh -r

您只需使用其中一个,安装并链接到会话即可。另请注意,受限 shell 并不安全。

相关内容