View previous topic :: View next topic |
Author |
Message |
gpstefansson n00b
Joined: 31 Oct 2006 Posts: 17
|
Posted: Mon Nov 26, 2007 9:31 am Post subject: Howto setup user to use only ssh and poweroff command? |
|
|
Hi all,
the title pretty much says it all... How do I set up a user that can connect to my Gentoo box through ssh and poweroff the machine? It is better if the user cannot logon to do other things...
thanks! _________________ Gentoo 2.6.17-r8 x86_64 running on:
Asus K8S-MX motherboard, 1GB Kingston DDR400, AMD Sempron 2600+ Processor, nVidia GeForce 6200 Graphics card. |
|
Back to top |
|
|
di1bert l33t
Joined: 16 May 2002 Posts: 963 Location: Oslo, Norway
|
Posted: Mon Nov 26, 2007 10:06 am Post subject: |
|
|
There is a number of ways to do it. I'd set him up in sudo for the shutdown command
and create a very simply dialog front end script and make this his shell.
That way when he logs in he always gets the dialog script and can only
use the shutdown command.
Let me know if you'd like a hand with this.
-m |
|
Back to top |
|
|
gpstefansson n00b
Joined: 31 Oct 2006 Posts: 17
|
Posted: Mon Nov 26, 2007 10:59 am Post subject: |
|
|
Thanks for the reply dilbert!
What I am basically looking for is to allow this user to execute a single command using for example Putty, from Windows that runs the poweroff command. See: here.
Then I would place the call to Putty in a .bat file with all parameters there so that the user would only have to execute the .bat file to power off the Gentoo box. The user needs no other access to the machine.
Im just wondering if a dialog front end script is needed for this... Trying to keep this simple and quick _________________ Gentoo 2.6.17-r8 x86_64 running on:
Asus K8S-MX motherboard, 1GB Kingston DDR400, AMD Sempron 2600+ Processor, nVidia GeForce 6200 Graphics card. |
|
Back to top |
|
|
di1bert l33t
Joined: 16 May 2002 Posts: 963 Location: Oslo, Norway
|
Posted: Mon Nov 26, 2007 11:13 am Post subject: |
|
|
That makes it even more simple....
Just create a script with the following in it
and put it in the users home directory. Then use putty / putty-keygen to create keys for
a passwordless login and run this command / script from putty (there is an option to put a "remote command to run")...
Should be a snap to do.
-m |
|
Back to top |
|
|
Dagger Retired Dev
Joined: 11 Jun 2003 Posts: 765 Location: UK
|
Posted: Mon Nov 26, 2007 12:00 pm Post subject: |
|
|
dont forget to:
and add
Code: |
USERNAME ALL=(ALL) NOPASSWD: /sbin/halt # change USERNAME to your user name
|
to your /etc/sudoers file _________________ 95% of all computer errors occur between chair and keyboard (TM)
Join the FSF as an Associate Member!
Post under CC license. |
|
Back to top |
|
|
|