Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2005

    Editing /etc/profile? Can't as root

    I wanted to change bash history # lines kept and tried to edit this file, but says permission denied.
    -rw-r--r-- 1 root root 842 May 24 2004 /etc/profile
    I am logged in as root (from su), but says permission denied. I have tried editing other root only files (with same permissions), and works ok?
    Anyone know why root can't edit this file and some way around it?

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Nottingham, England
    Your filesystem isn't mounted read-only is it?

    You could also try using 'su -' to change to the root user instead of 'su'.
    Linux user #126863 - see

  3. #3
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    I wouldn't edit /etc/profile anyway. Your changes may get clobbered during certain updates.

    Instead edit ~/.profile for the user(s).

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts