You are not logged in.

#1 2009-10-31 14:56:22

unregistered
Member
Registered: 2008-04-09
Posts: 134

needing root while shell scripting

so some of my statements in my shell scripts need to run as root, is there a way to prevent the need to prompt the user for the root password everytime the script is run? ( I'm using sudo [insert commands here]. Is there a more elegant way of doing this? )

Offline

#2 2009-10-31 18:18:17

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: needing root while shell scripting

I don't believe there's a more elegant way, no but in the sudoers file you can specify certain commands that can be run without prompting for a password.  For example:

%wheel  ALL=(ALL) NOPASSWD:/sbin/shutdown

All users in the wheel group can execute shutdown as root without entering a password.


thayer williams ~ cinderwick.ca

Offline

Board footer

Powered by FluxBB