Why am I able to still write to a file marked 400

ForeverLearner
root@user123:~# touch 1.pwd
root@user123:~# chmod 400 1.pwd
root@user123:~# echo "abc" > 1.pwd

root@user123:~# vi 1.pwd

root@user123:~# ls -lart
total 3344
-rw-r--r--  1 root root     148 Aug 17  2015 .profile
-rw-r--r--  1 root root    3106 Apr  9  2018 .bashrc
drwx------  3 root root    4096 Dec 13 13:35 .dbus
drwxr-xr-x  3 root root    4096 Dec 13 13:35 .local
drwx------  7 root root    4096 Feb 21 10:47 .config
-rw-------  1 root root   39013 Mar  4 11:57 .bash_history
drwx------ 12 root root    4096 Mar  4 12:45 .
-r--------  1 root root       4 Mar  4 12:45 1.pwd

root@user123:~# echo "no change" >> 1.pwd
root@user123:~# cat 1.pwd
abc
no change

The permission management successfully alters the file to read-only. Then why would writes to the file still succeed. How can I avoid this situation.

roaima

Standard permissions can be overridden by root.

Simple solution: don't use root unless you really need to do so. That way you're far less likely to delete or break something vital to the system

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why am I able to open this file?

From Dev

am I still able to set sessions?

From Dev

Why am I not able to use relative path to open a file in CLion?

From Dev

How to use a file with a BufReader and still be able to write to it?

From Dev

Javascript: if 'abstract' is a reserved word why I am still able to use it as an identifier?

From Dev

Javascript: if 'abstract' is a reserved word why I am still able to use it as an identifier?

From Dev

Why am I not being able to write into objects I fetched from database?

From Dev

I am not able to write on a network drive (Hosted with samba) using a php program. Why?

From Dev

Why is the file I am attempting to write "non-existing"?

From Dev

Why am I not Able to Construct This Regex

From Dev

Why am I not able to open a VS project

From Dev

Why am I not able to wget these types of links?

From Dev

Why am I not able to change worksheet reference?

From Dev

Why am I not able to add a JPanel to a JPanel?

From Dev

Why am I not able to use $this is an opencart helper?

From Dev

Why am I not able to add this route?

From Dev

Why am I not able to buy applications?

From Dev

I am not able to get the file path

From Dev

Why am I getting a 400 response code?

From Dev

Why am I still seeing old icon?

From Dev

Why am I not able to compile a file that references jquery.d.ts?

From Dev

Why am I only able to read/processs one file from an SI MessageSource?

From Dev

Why I am no able to install audacity from neither the ppa repositories, nor the the .deb file?

From Dev

Why I am Not able to create and add data to the sqlite file at the same time?

From Dev

Why Am I able to edit /etc/resolv.conf on a read only file system?

From Dev

I am using angular 2 and I have created a form and Marked fields as required but still my got submitted

From Dev

Can't write to a file that I own and is marked as writeable?

From Dev

With CTE why i am not able to print 1 to 1000 number or more but 1 to 100 i am able to print

From Dev

Why am i not able to print the whole character as i have entered it?

Related Related

  1. 1

    Why am I able to open this file?

  2. 2

    am I still able to set sessions?

  3. 3

    Why am I not able to use relative path to open a file in CLion?

  4. 4

    How to use a file with a BufReader and still be able to write to it?

  5. 5

    Javascript: if 'abstract' is a reserved word why I am still able to use it as an identifier?

  6. 6

    Javascript: if 'abstract' is a reserved word why I am still able to use it as an identifier?

  7. 7

    Why am I not being able to write into objects I fetched from database?

  8. 8

    I am not able to write on a network drive (Hosted with samba) using a php program. Why?

  9. 9

    Why is the file I am attempting to write "non-existing"?

  10. 10

    Why am I not Able to Construct This Regex

  11. 11

    Why am I not able to open a VS project

  12. 12

    Why am I not able to wget these types of links?

  13. 13

    Why am I not able to change worksheet reference?

  14. 14

    Why am I not able to add a JPanel to a JPanel?

  15. 15

    Why am I not able to use $this is an opencart helper?

  16. 16

    Why am I not able to add this route?

  17. 17

    Why am I not able to buy applications?

  18. 18

    I am not able to get the file path

  19. 19

    Why am I getting a 400 response code?

  20. 20

    Why am I still seeing old icon?

  21. 21

    Why am I not able to compile a file that references jquery.d.ts?

  22. 22

    Why am I only able to read/processs one file from an SI MessageSource?

  23. 23

    Why I am no able to install audacity from neither the ppa repositories, nor the the .deb file?

  24. 24

    Why I am Not able to create and add data to the sqlite file at the same time?

  25. 25

    Why Am I able to edit /etc/resolv.conf on a read only file system?

  26. 26

    I am using angular 2 and I have created a form and Marked fields as required but still my got submitted

  27. 27

    Can't write to a file that I own and is marked as writeable?

  28. 28

    With CTE why i am not able to print 1 to 1000 number or more but 1 to 100 i am able to print

  29. 29

    Why am i not able to print the whole character as i have entered it?

HotTag

Archive