hello,

the user that does the ssh is what does the copy..

HOST -> guest user by ssh, say vagrant -> file (owner vagrant)

If you can explain a bit more the requirement, I can give you some
suggestions,

If root user is 100% required, I probably will use a shell provider after
the sync, to move and set permissions.
a different approach will be override the ssh user/pass to use the sync as
root.. not sure how easy this will be, without a better idea of the
requirement.

options are.. but why you need root user and /root/ ?

since if they are for security, then the potential solution becomes more
complex tricky

getme the output of this command please

mkdir -p /root/p1/puppet
getfacl /root/p1/puppet

if vagrant user can have access to /root/p1/puppet and your guest is linux,
you may use acls



Alvaro.


On Fri, Oct 31, 2014 at 10:38 AM, San <[email protected]> wrote:

> I need to be able to sync some stuff in /root directory: Is there a way I
> can rsync as root-user or with sudo. It's possible with rsync command from
> the CLI, using --rsync-path="sudo rsync" option. Is it anything similar
> in Vagrant available? My attempt of using owner: "root", group: "root" in
> synced_folder settings didn't work, throwing in errors like these:
>
> rsync: ERROR: cannot stat destination "/root/p1/puppet": Permission denied
> (13)
> rsync error: errors selecting input/output files, dirs (code 3) at
> main.c(583) [Receiver=3.0.9]
> rsync: connection unexpectedly closed (8 bytes received so far) [sender]
> rsync error: error in rsync protocol data stream (code 12) at
> /SourceCache/rsync/rsync-42/rsync/io.c(452) [sender=2.6.9]
>
>
> This is what I got in my Vagrantfile:
>
> config2.vm.synced_folder "../puppet",
> "/root/"+nodes_cfg['aws_env']+"/puppet", type: "rsync",
>                          owner: "root", group: "root", rsync__exclude:
> [".git/", "ORG_*/", "OLD_*/"]
>
>
> Am I missing out anything or anyone know any workaround? Best!!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to