su command question

Robert Dailey rcdailey at gmail.com
Sat Jul 5 17:51:55 UTC 2008


On Sat, Jul 5, 2008 at 11:14 AM, Nils Kassube <kassube at gmx.net> wrote:
> Robert Dailey wrote:
>> Basically, I'm trying to run a Ventrilo server, but the documentation
>> for Ventrilo suggests that you run the server as a user named
>> "ventrilo". That way, I can use chmod and chown to give the server
>> access rights to the files that the Ventrilo server will be
>> needing/accessing. The exact line of script I posted in my original
>> post was the suggested script to be run. However, I was surprised to
>> find (mainly due to my lack of experience) that I had to enter a
>> password prompt each time I ran my script to start the server.
>>
>> I plan to make this script "hands-free", because later on I'm going to
>> be adding this to my /etc/rc.d/rc.local so that the server starts by
>> itself every time I reboot the server. "hands-free" here means
>> basically that the script does not require any user interaction, such
>> as requesting passwords.
>
> If the script is run from /etc/rc.d/rc.local it will be run by root. Then
> there is no password prompt because root may su to any user without being
> asked for a password. So your original command is OK already. You can
> test it if you get a root shell using the command "sudo su". If you then
> try the command again you will see that there is no password prompt.

That's excellent, I didn't know that rc.local is run by root. That
solves starting the server at boot time, however what if I want to
issue the Ventrilo server start/stop commands without being prompted?
Is this when I use "sudo su" together?




More information about the ubuntu-users mailing list