[asterisk-users] asterisk as non-root/best practices

Anthony Francis anthonyf at rockynet.com
Sat Dec 1 11:27:12 CST 2007


Robert McNaught wrote:
> not in path
>
> [admin at XXXXXX]$ echo $PATH
> /usr/kerberos/bin:/usr/lib/courier-imap/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/admin/bin
>
>>  Is /sbin in your path? 
>>
>>  CP 
>>
>>  Robert McNaught wrote: 
>>  >  
>>  > my problem is that a non-privileged user, eg admin, cannot log in and 
>>  > connect to the console by issuing the following 
>>  >  
>>  > [admin at XXXX]$ asterisk -r 
>>  > bash: asterisk: command not found 
>>  >  
>>  > [admin at XXXXX]$ whereis asterisk 
>>  > asterisk: /usr/sbin/asterisk /usr/lib/asterisk /usr/include/asterisk 
>>  > /usr/include/asterisk.h /usr/share/man/man8/asterisk.8 
>>  >  
>>  > what is the best way to solve this problem? 
>>  >  
>>  > i have tried adding 
>>  >  
>>  > admin   ALL=(ALL)       ALL    - I will prune back once I verify I can 
>>  > get this working 
>>  >  
>>  > into visudo, but even that returns asterisk:command not found 
>>  >  
>>  > Does anyone out there know the best way around this - I tried adding in 
>>  > a symbolic link in /usr/bin/asterisk to point to the 
>>  > /home/asterisk/asterisk-bin/sbin/asterisk file, which worked, but is a 
>>  > hack around the problem and don't believe this is the way 
>>  >  
>>  > It seems that non-privileged users cannot run commands in sbin, but can 
>>  > in bin directories 
>>  >  
>>  > Robert 
>>  >  
>>
>>
>>
>>     
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
Then put /usr/sbin in your path, then you will be able to launch it. or 
you can use alias, which is particularly good if you need to use sudo to 
launch asterisk, my alias entry reads:
alias asterisk='sudo /usr/sbin/asterisk -r'

Then if I want to do the -rx thing I can just call asterisk -x because 
the -r is already present.



More information about the asterisk-users mailing list