Can't move or delete files even after chown and chmod

I can't seem to move or delete files in my home directory even after chmod

and chown

.

At first glance, the permissions appear to be configured correctly.

user@f9195084fbf8:~$ ls -lah
total 32K
drwxr-xr-x 18 user user 4.0K Oct  8 17:35 .
drwxr-xr-x 16 root root 4.0K Oct  8 04:57 ..
-rwxr-xr-x  1 user user  220 Apr  3  2012 .bash_logout
-rwxr-xr-x  1 user user 3.5K Apr  3  2012 .bashrc
drwxr-xr-x  2 user user 4.0K Oct  8 05:43 .matplotlib
drwxr-xr-x  2 user user 4.0K Oct  8 17:19 .pip
-rwxr-xr-x  1 user user  675 Apr  3  2012 .profile
drwxr-xr-x 15 user user 4.0K Oct  8 04:58 .virtualenvs

      

But I cannot delete the existing files.

user@f9195084fbf8:~$ rm .bashrc
rm: cannot remove `.bashrc': Operation not permitted

      

So I try chown

and chmod

, but it still doesn't work.

user@f9195084fbf8:~$ sudo chown -R $USER:$GROUP .
user@f9195084fbf8:~$ sudo chmod -R 755 .          
user@f9195084fbf8:~$ rm .bashrc
rm: cannot remove `.bashrc': Operation not permitted
user@f9195084fbf8:~$ mv .bashrc .virtualenvs/
mv: cannot move `.bashrc' to `.virtualenvs/.bashrc': Operation not permitted

      

However, I can write and delete the files I just created.

user@f9195084fbf8:~$ echo 'hello' > test.txt
user@f9195084fbf8:~$ ls  
test.txt
user@f9195084fbf8:~$ rm test.txt

      

+3


source to share


1 answer


Is there any immutable attribute set in the file?

lsattr .bashrc

      

If so, you can fix it:



chattr -i -a .bashrc

      

Run man chattr

to see flags, or see the wiki page .

+2


source







All Articles