LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-07-2009, 09:27 AM   #1
Ukuntu
LQ Newbie
 
Registered: Mar 2009
Distribution: Linux Mint
Posts: 2

Rep: Reputation: 0
Can't Modify .bashrc as root


On one of my client's servers I attempted to modify ~/.bashrc as root to add in some aliases and update $PATH

Well on this particular system, for some reason all the /root SSH profile files are read only and I cannot modify. When I open them in VI it says read only and :w! fails.

I checked and the user:group is root:root and the permissions are 0644. I attempted to chmod it to 777 and I got permission denied.

Anyone have any clue?
 
Old 04-07-2009, 09:54 AM   #2
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 97
What are the results of:

Code:
lsattr .bashrc
?

If the output contains an i like in "----i-------------- .bashrc" then the "immutable" bit is set, which prevents any changes being made. If so, execute:

Code:
chattr -i .bashrc
You will need to be root, or use sudo, to do this.

Edited to add: you could also try getfacl .bashrc to check whether an access control list has been set.

Last edited by Robhogg; 04-07-2009 at 09:58 AM. Reason: Another thought...
 
Old 04-07-2009, 09:58 AM   #3
Ukuntu
LQ Newbie
 
Registered: Mar 2009
Distribution: Linux Mint
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Robhogg View Post
What are the results of:

Code:
lsattr .bashrc
?

If the output contains an i like in "----i-------------- .bashrc" then the "immutable" bit is set, which prevents any changes being made. If so, execute:

Code:
chattr -i .bashrc
You will need to be root, or use sudo, to do this.
That worked. Thank you very much.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with root file .bashrc doraimom Debian 2 11-23-2008 08:43 AM
gpm-root can't be run from bashrc? atom Linux - Software 3 08-22-2005 03:27 PM
How to modify my .bashrc in general to accomodate running binaries (e.g. SCHEME)? Erik_the_Red Linux - Software 1 08-01-2005 12:23 PM
need root .bashrc .bash_profile darkRoom Slackware 5 04-30-2005 03:24 AM
how to modify .bashrc file amadan_in Linux - Newbie 1 01-01-2003 03:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration