Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

It's that simple:

root@server [/etc]# touch /etc/bashrc
touch: cannot touch '/etc/bashrc': Permission denied

OS: Linux

Distro: CentOS

Release: 5.3

Extras: cPanel installed

Any ideas?

share|improve this question

migrated from stackoverflow.com Aug 9 '10 at 16:51

This question came from our site for professional and enthusiast programmers.

    
Have you managed to get into some unusual situation where root isn't root? Do you have a uid of 0? –  Jefromi Aug 9 '10 at 16:51
    
Voting to close as this is non-programming related –  t0mm13b Aug 9 '10 at 16:51
    
Is selinux enabled? –  user52692 Oct 18 '10 at 9:53

3 Answers 3

Check if you have i attribute on the file:

# lsattr /etc/bashrc
----i------------e- /etc/bashrc

If yes, remove it:

# chattr -i /etc/bashrc
share|improve this answer

1) ls -l /etc/bashrc will show you attributes of the file, maybe its read-only even for root ?

2) Or it could be SELinux that prevents you from "writing" to the file.

share|improve this answer

The file could be also immutable. That would be odd. This is a sign of something wrong or pretty unusual.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.