[SOLVED] /etc/hosts file is read-only for root in ubuntu Server. But rw- is for root
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
/etc/hosts file is read-only for root in ubuntu Server. But rw- is for root
In my Ubuntu server 10 64bit, /etc/hosts file is read only. Rights of /etc/hosts are
-rw-r--r-- 1 root root 392 2012-03-09 09:55 hosts. But i am unable to edit the file. I do not have gui installed in it. /etc/resolv.conf is editable, but /etc/hosts file alone is not editable. This machine is in OPSource Cloud.
I did as u said the output is as follows
O/P
> EOF
-bash: /etc/hosts: Permission denied
* i created another file werty in /etc
-rw-r--r-- 1 root root 0 2012-03-14 05:28 werty
i am able to edit the file werty. I am not able to edit /etc/host file alone.....
Done it worked great.....thanks. How did the attributes got changed. This was a new machine created in cloud. Is there any scenario under which this change occurs? But i have not done any change to system related files
Was it installed by the provider or by you? I would assume that it was set up during installation to avoid that a bad setup could make the access to the machine impossible.
The only thing I wonder about now: the “e” showing up in your output. I don’t have it anywhere, and it’s also not explained in chattr man page. Is it explained in your version of the man page?
Machine was created from an image hosted in Op source Cloud. It was created and hosted as an image by third party. May be he has changed the attributes after installation and then took an image of it and hosted in Cloud
Man Page:
The 'e' attribute indicates that the file is using extents for mapping the blocks on disk. It may not be removed using chattr(1).
The 'e' was not removed when i gave chattr command. 'e' is found in Ubuntu Server 10 alone. But not in CentOS
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.