It's worth mentioning that a "sudo put" command could be implemented, it would just have to assume different things about what the server at the other end supports:
https://lists.ubuntu.com/archives/kubuntu-users/2006-April/005135.html On 1/17/08, Jamis Buck <[EMAIL PROTECTED]> wrote: > > The "put" command can't be done via sudo, because it uses SFTP (which > isn't a command you execute via a shell--it's a protocol run on top of > SSH). All SFTP operations are done as the same user that you are > logging into your servers as. Thus, if you want to be able to write to > a directory, you'll need to make sure that the user doing the writing > has the appropriate permissions. If that's not possible, you'll have > to do as you suggested, uploading to a temporary location and then > moving the file via sudo. > > It'd be the same sequence of steps if you were doing from the command- > line with the sftp utility, sadly. :( > > - Jamis > > On Jan 17, 2008, at 11:00 AM, gordoncww wrote: > > > > > I'd like to use capistrano to deploy my apache config script to a > > directory that my deployment user can't normally write to. My user > > can sudo just fine but the below runs into permission problems. > > > > task :create_apache_config do > > conf = render_erb_template(File.dirname(__FILE__) + "/templates/ > > apache.conf") > > put conf, "#{apache_conf_path}/#{application}.conf" > > end > > > > Is there a way to do this in one step or do I have to copy the file to > > the server, then do something like > > 'run "sudo mv tmp/#{application}.conf #{apache_conf_path}/ > > #{application}.conf"' ? > > The later seems ugly so I'm hoping there's a better way. > > > > > > > --~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
