我使用ssh的"forcecommand“选项来传递一个shell脚本,该脚本将帮助将用户从ssh中隔离出去。我想知道他们是否能够做到这一点,而不必强迫root也执行shell脚本。
谢谢!
发布于 2011-07-02 06:36:02
sshd允许我们覆盖选定用户(用户、组、主机或地址)的默认设置。
我们可以使用Match块对其进行编译。在Match块中,我们必须设置要更改的条件和设置。
我不知道是否可以在sshd_config中取消设置选项(例如,使用没有args的选项),但如果不可能,您可以创建一组您希望限制的用户组,并仅将ForceCommand应用于该组。
unset选项的配置:
Match User root
ForceCommand #some way to unset option?配置受限组:
Match Group restrictedsshd
ForceCommand /some/script.sh有关Match选项的更多信息,您可以在man sshd_config中找到。
发布于 2011-07-03 21:58:46
来自man sshd (LOGIN PROCESS):
3. Checks /etc/nologin; if it exists, prints contents and quits (unless root).
https://serverfault.com/questions/286353
复制相似问题