Find the answer to your Linux question:
Results 1 to 2 of 2
Dear All, i wrote a shell script to poweroff all my machines in my lab, In my lab every machines hold a student user account.Due to some reasons i am ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Posts
    13

    Poweroff as a normal user


    Dear All,
    i wrote a shell script to poweroff all my machines in my lab, In my lab every machines hold a student user account.Due to some reasons i am setting up this script to run as student user.But in some rhel-4 machines the output of the script shows "poweroff: must be superuser".what is the problem? how can i poweroff my machine while login as a normal user (without setting sudo).?.


    Advaned Thanks

  2. #2
    Linux Guru
    Join Date
    Jul 2004
    Posts
    4,593
    I think that maybe you want to use the shutdown command. Users that are allowed to use this command are then listed in the /etc/shutdown.allow file. For more info see the man pages.
    Code:
    man shutdown
    The shutdown.allow file simply lists the usernames of those allowed to run this command, nothing else. I use this command for shutting down one of my PC's that I have trouble shutting down any other way.
    Code:
    shutdown -h now
    Please do not send Private Messages to me with requests for help. I will not reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •