-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Hi,
I have the need to impersonate the execution of the command to achieve a password-less connection to the remote server with a user other than the current one.
To make it, I count on sudo to do the work and use in my sources the following piece of code as a quick workaround:
module Rsync
class << self
attr_accessor :sudo_as
end
class Command
def self.run(*args)
cmd = "rsync --itemize-changes #{args.join(" ")}"
cmd.insert(0, "sudo -u #{Rsync.sudo_as} ") if Rsync.sudo_as
output = run_command(cmd)
Result.new(output, $?.exitstatus)
end
end
end
Don't know if it's a good way to do it, but I hope will be of any help for a future enhancement.
Regards,
Metadata
Metadata
Assignees
Labels
No labels