Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When a script is run manually, it works with no errors. The script is to add a user. However when run in cron, I get emails saying:

sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.

The entry into cron was done via crontab -e.

share|improve this question
    
What is the script? –  Waldir Leoncio Dec 11 '13 at 18:04
    
The script is sudo useradd -p $K -m $U –  John Smith Dec 11 '13 at 18:05
    
why would anyone even try to make cronjob to add user? Just for curiosity. –  souravc Dec 11 '13 at 18:08
1  
@JohnSmith have you tried using root's crontab? –  souravc Dec 11 '13 at 18:20
    
I thought to run roots crontab was sudo crontab -e? –  John Smith Dec 11 '13 at 18:22
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.