[Dirvish] How to fix sudo: no tty present and no askpass program specified

Don Gould don at bowenvale.co.nz
Thu Jul 17 00:32:21 UTC 2014


The following is provided to the list for info only.  Readers are 
welcome to comment if they see something wrong or of interest.

Below are more details on how we managed to resolve our issue with tty 
issues in a sudo set up.

Readers are welcome to make contact if they have further questions.


Further to: http://www.dirvish.org/pipermail/dirvish/2005-June/000387.html

RSYNC_ERR:        sudo: no tty present and no askpass program specified
RSYNC_ERR:        rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
RSYNC_ERR:        rsync error: error in rsync protocol data stream (code 12) at io.c(605) [Receiver=3.0.9]

rsync -a -e 'ssh -t' --rsync-path="sudo rsync" $*

# this prevents the tty and passkey ask issues.

 From man rsync

-e, --rsh=COMMAND            specify the remote shell to use

     --rsync-path=PROGRAM     specify the rsync to run on remote machine

You can put the override in the default.conf - this is useful

client: bkuser at yourserver.fqdn
tree: /var/www

xdev: true
index: gzip
image-default: %Y%m%d-%H%M
rsync-client: "/usr/local/bin/rsync-new"


In sudoer on target machine

bkuser    ALL = NOPASSWD: /usr/bin/rsync
bkuser     ALL = NOPASSWD: /usr/local/bin/rsync-new
Defaults!/usr/local/bin/rsync-new !requiretty
Defaults!/usr/bin/rsync !requiretty

Note security issues in thread linked above.

Don Gould
31 Acheson Ave
Christchurch, New Zealand
Ph: + 64 3 348 7235
Mobile: + 64 21 114 0699
Ph: +61 3 9111 1821 (Melb)


Deja vue (missing the French accent mark) - literally means already seen, that sense of haven't we been here before.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.dirvish.org/pipermail/dirvish/attachments/20140717/435c572d/attachment.html 

More information about the Dirvish mailing list