CentOS6でサーバを構築しています。
その管理のためにShellinaboxを導入したいのですが、リバースプロキシ、SSHの設定をしたところログイン画面は見えるのですが、IDを入力するとSession closed. になってログインできません。
https://github.com/shellinabox/shellinabox/issues/88
このサイトの
From luka.kra...@gmail.com on January 12, 2015 13:16:45
For future readers :)
I had the same issue on my CentOS 6.6 and I found out that the code from shellinabox/launcher.c replaces "@localhost" in ssh command with "@hostname.domain" (output of command uname -n) ...
[luka@hostname shellinabox]$ uname -n
hostname.domain
This is quick patch that I am using (but than you missout on nice shell prompt):
diff --git a/shellinabox/launcher.c b/shellinabox/launcher.c
index 68d8862..3aa9100 100644
--- a/shellinabox/launcher.c
+++ b/shellinabox/launcher.c
@@ -1000,16 +1000,16 @@ static pam_handle_t *internalLogin(struct Service *service, struct Utmp *utmp,
// Replace '@localhost' with the actual host name. This results in a nicer // prompt when SSH asks for the password.
- char *ptr = strrchr(cmdline, '@');
- if (!strcmp(ptr + 1, "localhost")) {
-
int offset = ptr + 1 - cmdline;
-
check(cmdline = realloc(cmdline,
-
strlen(cmdline) + strlen(fqdn) -
-
strlen("localhost") + 1));
-
ptr = cmdline + offset;
-
*ptr = '\000';
-
strncat(ptr, fqdn, strlen(fqdn));
- }
-
// char *ptr = strrchr(cmdline, '@');
-
// if (!strcmp(ptr + 1, "localhost")) {
-
// int offset = ptr + 1 - cmdline;
-
// check(cmdline = realloc(cmdline,
-
// strlen(cmdline) + strlen(fqdn) -
-
// strlen("localhost") + 1));
-
// ptr = cmdline + offset;
-
// *ptr = '\000';
-
// strncat(ptr, fqdn, strlen(fqdn));
-
// }
free((void *)service->cmdline);
service->cmdline = cmdline;
I think that the correct thing to do here is to configure host and domain name, but i didn't try that (/etc/hosts and /etc/resolv.conf) ...
これをすればいいのではとなったのですが、luncher.cが見つけられません。
#find / -name luncher.cで探しています。
どうしたらいいでしょうか?
回答1件
あなたの回答
tips
プレビュー