HowTo: Save A File In Vim / Vi Without Root Permission

Posted by nixcraft on Apr 11, 2010 8:01 AM EDT
nixCraft
Mail this story
Print this story

This happens lot of times. I login as a normal user and start to edit httpd.conf or lighttpd.conf or named.conf in vim / vi text editor. However, I'm not able to save changes due to permission issue (all config files are owned by root). How do I save file without creating a temporary file (/tmp/httpd.conf) and then move the same (mv /tmp/httpd.conf /etc/httpd) as root using vim / vi itself?

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Debian, Red Hat, SUSE, Ubuntu

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.