Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am in process to set up a DHCP server on Ubuntu 12.04 Desktop.

I need to edit the file: /etc/default/isc-dhcp-server

How can I make it editable and save after applying necessary changes?

share|improve this question
up vote 0 down vote accepted


$ SUDO_EDITOR=/path/to/text-editor sudoedit /etc/default/isc-dhcp-server

From the sudo(8) manpage:

When invoked as sudoedit, the -e option (described below), is implied.


The -e (edit) option indicates that, instead of running a command, the user wishes to edit one or more files.


  1. Temporary copies are made of the files to be edited with the owner set to the invoking user.
  2. The editor specified by the policy is run to edit the temporary files. The sudoers policy uses the SUDO_EDITOR, VISUAL and EDITOR environment variables (in that order). […]
  3. If they have been modified, the temporary files are copied back to their original location and the temporary versions are removed.
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .