Readonly file and can't change permissions

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












1















There is a file with read only permissions, but even root can't chmod it.



Permissions of the file: -rw-r--r--



After trying to chmod 777:



chmod: changing permissions of ‘motd’: Operation not permitted


I'm doing it from the root account. How is it possible to lock a file like this?










share|improve this question



















  • 4





    lsattr /etc/motd and check if the immutable bit is set. You will see an i in the output if it is.

    – MikeA
    Sep 28 '16 at 16:01






  • 1





    What filesystem is this file on?

    – Gilles
    Sep 29 '16 at 0:06











  • Yeah it was lsattr I used chattr and I can change it now, thanks ;)

    – Furjoza
    Sep 29 '16 at 8:26















1















There is a file with read only permissions, but even root can't chmod it.



Permissions of the file: -rw-r--r--



After trying to chmod 777:



chmod: changing permissions of ‘motd’: Operation not permitted


I'm doing it from the root account. How is it possible to lock a file like this?










share|improve this question



















  • 4





    lsattr /etc/motd and check if the immutable bit is set. You will see an i in the output if it is.

    – MikeA
    Sep 28 '16 at 16:01






  • 1





    What filesystem is this file on?

    – Gilles
    Sep 29 '16 at 0:06











  • Yeah it was lsattr I used chattr and I can change it now, thanks ;)

    – Furjoza
    Sep 29 '16 at 8:26













1












1








1


0






There is a file with read only permissions, but even root can't chmod it.



Permissions of the file: -rw-r--r--



After trying to chmod 777:



chmod: changing permissions of ‘motd’: Operation not permitted


I'm doing it from the root account. How is it possible to lock a file like this?










share|improve this question
















There is a file with read only permissions, but even root can't chmod it.



Permissions of the file: -rw-r--r--



After trying to chmod 777:



chmod: changing permissions of ‘motd’: Operation not permitted


I'm doing it from the root account. How is it possible to lock a file like this?







permissions root chmod readonly






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 28 '16 at 16:42









Tomasz

9,37852965




9,37852965










asked Sep 28 '16 at 14:59









FurjozaFurjoza

612




612







  • 4





    lsattr /etc/motd and check if the immutable bit is set. You will see an i in the output if it is.

    – MikeA
    Sep 28 '16 at 16:01






  • 1





    What filesystem is this file on?

    – Gilles
    Sep 29 '16 at 0:06











  • Yeah it was lsattr I used chattr and I can change it now, thanks ;)

    – Furjoza
    Sep 29 '16 at 8:26












  • 4





    lsattr /etc/motd and check if the immutable bit is set. You will see an i in the output if it is.

    – MikeA
    Sep 28 '16 at 16:01






  • 1





    What filesystem is this file on?

    – Gilles
    Sep 29 '16 at 0:06











  • Yeah it was lsattr I used chattr and I can change it now, thanks ;)

    – Furjoza
    Sep 29 '16 at 8:26







4




4





lsattr /etc/motd and check if the immutable bit is set. You will see an i in the output if it is.

– MikeA
Sep 28 '16 at 16:01





lsattr /etc/motd and check if the immutable bit is set. You will see an i in the output if it is.

– MikeA
Sep 28 '16 at 16:01




1




1





What filesystem is this file on?

– Gilles
Sep 29 '16 at 0:06





What filesystem is this file on?

– Gilles
Sep 29 '16 at 0:06













Yeah it was lsattr I used chattr and I can change it now, thanks ;)

– Furjoza
Sep 29 '16 at 8:26





Yeah it was lsattr I used chattr and I can change it now, thanks ;)

– Furjoza
Sep 29 '16 at 8:26










1 Answer
1






active

oldest

votes


















-3














Verify the ownership of the file with



ls -l 


Change ownership of the file with



chown root motd





share|improve this answer

























  • root is the owner ;( -rw-r--r--. 1 root root 989 Sep 19 17:20 motd

    – Furjoza
    Sep 28 '16 at 15:52






  • 3





    @Furjoza But the dot at the end of the permission string indicates it has extended permissions. Edit in your question the output of ls -Z /etc/motd and lsattr /etc/motd and lsattr -d /etc

    – user4556274
    Sep 28 '16 at 15:56












  • Root doesn't need to own the file to modify either the file or the properties.

    – Stephan
    Sep 28 '16 at 20:05










Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f312950%2freadonly-file-and-cant-change-permissions%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









-3














Verify the ownership of the file with



ls -l 


Change ownership of the file with



chown root motd





share|improve this answer

























  • root is the owner ;( -rw-r--r--. 1 root root 989 Sep 19 17:20 motd

    – Furjoza
    Sep 28 '16 at 15:52






  • 3





    @Furjoza But the dot at the end of the permission string indicates it has extended permissions. Edit in your question the output of ls -Z /etc/motd and lsattr /etc/motd and lsattr -d /etc

    – user4556274
    Sep 28 '16 at 15:56












  • Root doesn't need to own the file to modify either the file or the properties.

    – Stephan
    Sep 28 '16 at 20:05















-3














Verify the ownership of the file with



ls -l 


Change ownership of the file with



chown root motd





share|improve this answer

























  • root is the owner ;( -rw-r--r--. 1 root root 989 Sep 19 17:20 motd

    – Furjoza
    Sep 28 '16 at 15:52






  • 3





    @Furjoza But the dot at the end of the permission string indicates it has extended permissions. Edit in your question the output of ls -Z /etc/motd and lsattr /etc/motd and lsattr -d /etc

    – user4556274
    Sep 28 '16 at 15:56












  • Root doesn't need to own the file to modify either the file or the properties.

    – Stephan
    Sep 28 '16 at 20:05













-3












-3








-3







Verify the ownership of the file with



ls -l 


Change ownership of the file with



chown root motd





share|improve this answer















Verify the ownership of the file with



ls -l 


Change ownership of the file with



chown root motd






share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 28 '16 at 16:39









Tomasz

9,37852965




9,37852965










answered Sep 28 '16 at 15:51









sbayerciscosbayercisco

251




251












  • root is the owner ;( -rw-r--r--. 1 root root 989 Sep 19 17:20 motd

    – Furjoza
    Sep 28 '16 at 15:52






  • 3





    @Furjoza But the dot at the end of the permission string indicates it has extended permissions. Edit in your question the output of ls -Z /etc/motd and lsattr /etc/motd and lsattr -d /etc

    – user4556274
    Sep 28 '16 at 15:56












  • Root doesn't need to own the file to modify either the file or the properties.

    – Stephan
    Sep 28 '16 at 20:05

















  • root is the owner ;( -rw-r--r--. 1 root root 989 Sep 19 17:20 motd

    – Furjoza
    Sep 28 '16 at 15:52






  • 3





    @Furjoza But the dot at the end of the permission string indicates it has extended permissions. Edit in your question the output of ls -Z /etc/motd and lsattr /etc/motd and lsattr -d /etc

    – user4556274
    Sep 28 '16 at 15:56












  • Root doesn't need to own the file to modify either the file or the properties.

    – Stephan
    Sep 28 '16 at 20:05
















root is the owner ;( -rw-r--r--. 1 root root 989 Sep 19 17:20 motd

– Furjoza
Sep 28 '16 at 15:52





root is the owner ;( -rw-r--r--. 1 root root 989 Sep 19 17:20 motd

– Furjoza
Sep 28 '16 at 15:52




3




3





@Furjoza But the dot at the end of the permission string indicates it has extended permissions. Edit in your question the output of ls -Z /etc/motd and lsattr /etc/motd and lsattr -d /etc

– user4556274
Sep 28 '16 at 15:56






@Furjoza But the dot at the end of the permission string indicates it has extended permissions. Edit in your question the output of ls -Z /etc/motd and lsattr /etc/motd and lsattr -d /etc

– user4556274
Sep 28 '16 at 15:56














Root doesn't need to own the file to modify either the file or the properties.

– Stephan
Sep 28 '16 at 20:05





Root doesn't need to own the file to modify either the file or the properties.

– Stephan
Sep 28 '16 at 20:05

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f312950%2freadonly-file-and-cant-change-permissions%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay