# Sync folder from remote permissions denied

**URL:** <https://forum.ansible.com/t/sync-folder-from-remote-permissions-denied/17804>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [March 21, 2015, 2:55pm UTC](https://forum.ansible.com/t/sync-folder-from-remote-permissions-denied/17804 "2015-03-21T14:55:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anatol](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Anatol](https://forum.ansible.com/u/Anatol)\
**Post date:** [March 21, 2015, 2:55pm UTC](https://forum.ansible.com/t/sync-folder-from-remote-permissions-denied/17804/1 "2015-03-21T14:55:29Z")

</div>

Hi,

I´d like to sync logfiles from a remote ubuntu 12.04 server to my local computer:

That´s what my Playbook looks like:

`

- hosts: “{{targets}}”  
vars:  
remote\_user: “{{username}}”  
tasks:

- name: Synchronize log files  
synchronize: src=/var/log/apache2/ dest=/Users/me/Desktop/logs/ mode=pull  
sudo: yes

`

unfortuntely it fails with:

`  
msg: sudo: no tty present and no askpass program specified  
Sorry, try again.

`

If I run the playbook without **sudo:yes** I get a permission denied as the specified user is not member  
of root or adm group.

(That´s what the Remote Folder looks like )

`  
drwxr-x— 3 root adm 12288 Mar 15 06:25 apache2

`

I think a workaround could be to add the user to root or adm group or change chmod of the remote folder,  
but this is a kind of ugly. Is there a way to grant rights (sudo -i) to the user via ansible?

best,

anatol

---

<div class="post-metadata">

**Author:** ![Anatol](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Anatol](https://forum.ansible.com/u/Anatol)\
**Post date:** [March 21, 2015, 4:35pm UTC](https://forum.ansible.com/t/sync-folder-from-remote-permissions-denied/17804/2 "2015-03-21T16:35:31Z")

</div>

As I disabled root access from ssh, I´ve ended up adding the user to adm group

`  
sudo usermod -aG adm

`

and exluded a file which belongs to root

`  
synchronize: src=/var/log/apache2/ dest=/Users/me/Desktop/logs/ mode=pull rsync\_opts=–exclude=.elinks

`
