From b68ebad5a9753ca15fed10f21cb1ee9931b8d858 Mon Sep 17 00:00:00 2001 From: Nicolas Viennot Date: Fri, 1 Nov 2013 13:47:30 -0400 Subject: [PATCH] Little help with sudo --- tmate-ssh-server.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tmate-ssh-server.c b/tmate-ssh-server.c index 05680bfc..3e9b2a6b 100644 --- a/tmate-ssh-server.c +++ b/tmate-ssh-server.c @@ -331,8 +331,12 @@ void tmate_ssh_server_main(const char *keys_dir, int port) client->ip_address, sizeof(client->ip_address)) < 0) tmate_fatal("Error getting IP address from connection"); - if ((pid = namespace_fork()) < 0) - tmate_fatal("Can't fork in new namespace"); + if ((pid = namespace_fork()) < 0) { + if (getuid() == 0) + tmate_fatal("Can't fork in new namespace, are you running a recent kernel?"); + else + tmate_fatal("Can't fork in new namespace, run me with root priviledges"); + } if (pid) { tmate_info("Child spawned pid=%d, ip=%s",