我们的用户正在使用ssh shell来运行所有CVS actitivies。是否可以阻止它们物理登录到CVS服务器?例如,他们使用以下命令签出文件:
cvs -z3 -d:ext:username@cvsserver:/cvsroot/projects checkout -d project1 .
由于他们是具有在服务器上读/写CVS存储库文件系统的权限的组的一部分,因此他们可以SSH登录到repo服务器并删除物理文件。我能阻止他们吗?我曾尝试使用DeneyUsers进行sshd_config,或者使用NOLOGON shell设置/ etc / passwd,但它们都会阻止CVS命令。
谢谢
答案 0 :(得分:0)
是的,有可能。我正在使用仅执行cvs的自定义shell。
以下是代码:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char** argv)
{
if (getenv("CVSROOT") == NULL)
setenv("CVSROOT", "/home/cvs", 0);
execl("/usr/bin/cvs", "cvs", "server", NULL);
printf("No Permission.\n");
}
答案 1 :(得分:0)
您可以安装rssh
并将其设置为用户的登录shell。
http://www.pizzashack.org/rssh/
rssh有一个可以限制用户的命令列表(包括cvs
)。如果他们尝试直接进入机器,他们将被拒绝并收到如下信息:
This account is restricted by rssh.
Allowed commands: cvs
If you believe this is in error, please contact your system administrator.