We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
sudo: no tty present and no askpass program specified
-
- Posts: 50
- Joined: Mon Oct 27, 2014 10:04 am
sudo: no tty present and no askpass program specified
Hi All,
Ubuntu 16.04.5 running VestaCP 0.9.8-22
I'm using a script to copy a backup file to dropbox. The script is stored in /usr/local/bin, has 0755 permissions and is owned by admin:admin.
Running the script from the command line works perfectly.
Setting it as a CRON job generates the following error:
sudo: no tty present and no askpass program specified
Any ideas how to fix this?
Thanks,
Adam
Ubuntu 16.04.5 running VestaCP 0.9.8-22
I'm using a script to copy a backup file to dropbox. The script is stored in /usr/local/bin, has 0755 permissions and is owned by admin:admin.
Running the script from the command line works perfectly.
Setting it as a CRON job generates the following error:
sudo: no tty present and no askpass program specified
Any ideas how to fix this?
Thanks,
Adam
Re: sudo: no tty present and no askpass program specified
not really vesta related, you will find a solution using google or take a look here: https://stackoverflow.com/questions/216 ... fied-error
-
- Posts: 50
- Joined: Mon Oct 27, 2014 10:04 am
Re: sudo: no tty present and no askpass program specified
I've used Google, extensively, to find a solution, to no avail.
The link you posted is not relevant to my situation. There are more relevant, VestaCP-related posts that ask similar questions, with a variety of answers, none of which work for me.
Anyone else?
The link you posted is not relevant to my situation. There are more relevant, VestaCP-related posts that ask similar questions, with a variety of answers, none of which work for me.
Anyone else?
Re: sudo: no tty present and no askpass program specified
The problem is, that the cron needs sudo permission and want to ask for the password. The link I've sent to you is exactly about this issue - maybe you can search a sys admin that can help you out at your issue.missionaryman wrote: ↑Tue Oct 02, 2018 1:15 amI've used Google, extensively, to find a solution, to no avail.
The link you posted is not relevant to my situation. There are more relevant, VestaCP-related posts that ask similar questions, with a variety of answers, none of which work for me.
Anyone else?
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: sudo: no tty present and no askpass program specified
in your /etc/hosts put your hostname in front of 127.0.0.1
-
- Posts: 11
- Joined: Sat Nov 23, 2019 1:37 am
- Os: Ubuntu 17x
- Web: apache + nginx
Re: sudo: no tty present and no askpass program specified
I know this is slightly old, but it is still relevant. I have an install of VestaCP running on Ubuntu 18.04 LTS.
How exactly do I clear this up?
I have added the host names to 127.0.0.1 in the hosts file but editing the visudo I am still sketchy on. I have only had VestaCP loaded for a week, so I am sure these commands will get longer, but I am seeing emails for the following:
sudo /usr/local/vesta/vin/v-update-sys-queue backup
sudo /usr/local/vesta/vin/v-update-sys-rrd
sudo /usr/local/vesta/vin/v-update-sys-vesta-all
All of these are coming from the Cron Daemon.
How exactly do I clear this up?
I have added the host names to 127.0.0.1 in the hosts file but editing the visudo I am still sketchy on. I have only had VestaCP loaded for a week, so I am sure these commands will get longer, but I am seeing emails for the following:
sudo /usr/local/vesta/vin/v-update-sys-queue backup
sudo /usr/local/vesta/vin/v-update-sys-rrd
sudo /usr/local/vesta/vin/v-update-sys-vesta-all
All of these are coming from the Cron Daemon.
-
- Posts: 23
- Joined: Mon Nov 21, 2016 5:47 am
- Os: CentOS 6x
- Web: apache + nginx
Re: sudo: no tty present and no askpass program specified
I have recently started to get them too,
getting email from cron:
v-update-sys-rrd
v-update-sys-queue backup
also those scripts are listed under cron under a non admin user.
maybe I should remove them from that user since they are already listed in the user admin cron?
thanks
getting email from cron:
v-update-sys-rrd
v-update-sys-queue backup
also those scripts are listed under cron under a non admin user.
maybe I should remove them from that user since they are already listed in the user admin cron?
thanks
Re: sudo: no tty present and no askpass program specified
ok...since no one has solved this issue here ill go ahead and post the solutions.. ScIT had it right actually you just had to read what the StackOverflow article was saying.
so I have a CRON script that needs root at
called
so the problem is that VESTA runs CRON under the admin user, so what should it do to run a root script since admin has never logged in?
the answer is in visudo...specifically run
at the end, use the template
so in this case...
save the file with <esc>:w! and you should be GTG.
so I have a CRON script that needs root at
Code: Select all
/home/admin/web/lasvegasluxerealty.com/public_html/rets
Code: Select all
do_full_rets_update
the answer is in visudo...specifically run
Code: Select all
sudo visudo
Code: Select all
username ALL = NOPASSWD: /fullpath/to/command
Code: Select all
admin ALL=NOPASSWD: /home/admin/web/lasvegasluxerealty.com/public_html/rets/do_full_rets_update
Re: sudo: no tty present and no askpass program specified
In my case removing "sudo" from cron command helped.
These commands usually run with admin /root privileges so no need for sudo.
This article is useful as well:
https://askubuntu.com/questions/590339/ ... -my-server
Contains:
How to find cron user?
Silence a command like this (temporary solution to not get spammed by cron):
These commands usually run with admin /root privileges so no need for sudo.
This article is useful as well:
https://askubuntu.com/questions/590339/ ... -my-server
Contains:
How to find cron user?
Code: Select all
sudo grep -R "/usr/local/vesta/bin/v-update-sys-queue backup" /etc/cron* /var/spool/cron/crontabs
Code: Select all
*/5 * * * * sudo /usr/local/vesta/bin/v-update-sys-queue backup > /dev/null 2>&1
-
- Posts: 23
- Joined: Mon Nov 21, 2016 5:47 am
- Os: CentOS 6x
- Web: apache + nginx
Re: sudo: no tty present and no askpass program specified
Maybe this helps someone,
I have several servers with vesta, from some I get this error, from others I dont,
what I discovered,
is that the servers that I dont get the error from, dont have those cron jobs listed, only sudo user (admin) have the cron job.
the servers that give this error are servers that have the cron job on users that dont have sudo permissions,
I think this happens when I import a admin account on a new server as a new non-admin user,
then the admin account cron jobs get imported, but since the user is not an admin the error gets generated.
I have several servers with vesta, from some I get this error, from others I dont,
what I discovered,
is that the servers that I dont get the error from, dont have those cron jobs listed, only sudo user (admin) have the cron job.
the servers that give this error are servers that have the cron job on users that dont have sudo permissions,
I think this happens when I import a admin account on a new server as a new non-admin user,
then the admin account cron jobs get imported, but since the user is not an admin the error gets generated.