sshd如何知道调用shell?

当我输入ssh remote-host命令时,sshd将为我运行bash -c命令.

sshd如何知道使用-c选项调用bash?

哦该死的,这是在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标准吧?

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...