Editing Files Owned by Root in /etc

Discussion in 'macOS' started by Avellinese, Sep 21, 2012.

  1. Avellinese macrumors newbie

    Joined:
    Sep 21, 2012
    #1
    I use a terminal window to ssh to a remote server. The connection gets terminated after a short period of inactivity. I searched and found that I can solve this problem by editing a configuration file in /etc. But when I try to do that using emacs, it opens in "read-only" mode--the file is owned by the root account. How can I edit this file? Thanks for any help you can provide.
     
  2. waynep macrumors 6502

    Joined:
    Dec 31, 2009
    #2
    When you edit the file, you can preceded the command with "su". You'll have to have root credentials.

    ie: su edit filename
     

Share This Page