首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >sshd如何知道如何调用shell?

sshd如何知道如何调用shell?
EN

Server Fault用户
提问于 2011-12-24 11:44:30
回答 1查看 2K关注 0票数 3

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

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

EN

回答 1

Server Fault用户

回答已采纳

发布于 2011-12-24 12:08:11

该死,这是在OpenSSH的源代码中硬编码的。

来自OpenSSH 5.9p1的session.c源代码:

代码语言:javascript
复制
/*
 * 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标准吧?

票数 7
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/343942

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档