Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How to set-up "shutdown-only" user?
Date: Mon, 03 Dec 2012 21:43:55
Message-Id: 20121203233912.54353ece@khamul.example.com
In Reply to: [gentoo-user] How to set-up "shutdown-only" user? by Jarry
1 On Mon, 03 Dec 2012 21:36:01 +0100
2 Jarry <mr.jarry@×××××.com> wrote:
3
4 > Hi Gentoo-users,
5 >
6 > I'm facing this problem: I *have to* allow one non-root user
7 > to shutdown my server remotely (ssh). I know I could create
8 > account for him and add his login into /etc/shutdown.allow but
9 > I do not want to grant him full shell access.
10 >
11 > I thought about adding "/sbin/shutdown -a h now" as his shell
12 > into /etc/passwd so that right after he authenticates himself,
13 > shutdown is called. But I'm not sure something like this is
14 > possible (shutdown must be probably called from shel)...
15 >
16 > Or is there maybe some other way how to create very restricted
17 > account where user could not do anything else but call shutdown?
18 >
19 > Jarry
20
21
22 pdmenu
23
24 it's an ncurses menu-driven shell thingy, and you create one menu with
25 one command "shutdown"
26
27 The menu items calls a wrapper script that actually runs "shutdown &&
28 logout" so that his session isn't left hanging in mid air. We use
29 pdmenu extensively for the not-so-clever first line support folk and it
30 works well. From Windows they use PuTTY and all they see is a menu.
31
32
33 --
34 Alan McKinnon
35 alan.mckinnon@×××××.com