Let's say you have a web server where the htdocs and everything in it is owned by the apache daemon, wwwrun and it's group, www. What's the best way to set up an external web editor such as Bluefish or Coda that logs in via ssh(sftp), and edit files while still keeping permissions intact?
The best I've been able to figure out is logging into the box itself as myself and using sudo:
sudo -u wwwrun vi index.php
Obviously, I can't do that with Coda. Maybe I'm going about it the wrong way?