当我输入ssh remote-host command时,sshd将为我运行bash -c command。
sshd如何知道如何使用-c选项调用bash?
发布于 2011-12-24 12:08:11
该死,这是在OpenSSH的源代码中硬编码的。
来自OpenSSH 5.9p1的session.c源代码:
/*
* Execute the command using the user's shell. This uses the -c
* option to execute the command.
*/
argv[0] = (char *) shell0;
argv[1] = "-c";
argv[2] = (char *) command;
argv[3] = NULL;
execve(shell, argv, env);
perror(shell);
exit(1);所以我想这是POSIX标准吧?
https://serverfault.com/questions/343942
复制相似问题