cron adduser
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Debian support > Linux Debian support > cron adduser




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    cron adduser  
Séverin Richard


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-23-07 06:15 PM

hi,

creating a .php script:
<? exec( "useradd myuser" ); ?>

called by cron as root, does not create a user.


Can anybody tell me a way of search???
thx for idears.





[ Post a follow-up to this message ]



    Re: cron adduser  
Fredderic


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-23-07 06:15 PM

On Thu, 23 Aug 2007 16:35:20 +0200,=20
S=E9verin Richard <severin.richard@free.fr> wrote:

> creating a .php script:
> <? exec( "useradd myuser" ); ?>
> called by cron as root, does not create a user.

Just a guess here...  useradd doesn't want keyboard input, for example,
for the users initial password, does it?  Some programs, especially
those that want passwords, will fail to run if they're not connected to
a terminal.  There's usually options to provide the necessary
information more directly.


Fredderic





[ Post a follow-up to this message ]



    Re: cron adduser  
sk8r-365


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-24-07 12:14 AM

Horton heard a Who named Séverin Richard saying:
> hi,
>
> creating a .php script:
> <? exec( "useradd myuser" ); ?>
>
> called by cron as root, does not create a user.
>
>
> Can anybody tell me a way of search???

There may be some log entry stating the problem such as /var/log/daemon.log.
Could try running it directly from a terminal and see if there's any message
.
Plus, and I'm not certain this is needed, but you could add your user to
sudousers for that command with the NOPASSWD option. Like this (from my list
):
cmo     ALL= NOPASSWD: /usr/sbin/fetchnews

HTH,
--
sk8r-365

http://goodbye-microsoft.com/





[ Post a follow-up to this message ]



    Re: cron adduser  
Séverin Richard


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-24-07 12:14 PM

Fredderic wrote:
> On Thu, 23 Aug 2007 16:35:20 +0200,
> Séverin Richard <severin.richard@free.fr> wrote:
>
> 
>
>
> Just a guess here...  useradd doesn't want keyboard input, for example,
> for the users initial password, does it?  Some programs, especially
> those that want passwords, will fail to run if they're not connected to
> a terminal.  There's usually options to provide the necessary
> information more directly.
>
>
> Fredderic
I found the solution in another forum:
exec( "/usr/sbin/useradd sdfsf");
works.

The cron user does not have same $PATH than shell, and realpath have to
be used.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:37 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register