M BUZZ CRAZE NEWS
// general

why is chmod -rwx not removing all the permissions on my private key file, the answers here that I have seen did not help me?

By Mia Morrison
 chmod -rwx prac1
abayomi@AbayomiUsman:~/.ssh$ ll | grep prac1
-r-xr-xr-x 1 abayomi abayomi 2655 Feb 18 15:55 prac1*
-rwxrwxrwx 1 abayomi abayomi 574 Feb 18 15:55 prac1.pub*
abayomi@AbayomiUsman:~/.ssh$ chmod a-rwx prac1
abayomi@AbayomiUsman:~/.ssh$ ll | grep prac1
-r-xr-xr-x 1 abayomi abayomi 2655 Feb 18 15:55 prac1*
-rwxrwxrwx 1 abayomi abayomi 574 Feb 18 15:55 prac1.pub*
abayomi@AbayomiUsman:~/.ssh$ chmod -rwx prac1
abayomi@AbayomiUsman:~/.ssh$ chmod -rwx prac1
abayomi@AbayomiUsman:~/.ssh$ sudo chmod -rwx prac1
[sudo] password for abayomi:
abayomi@AbayomiUsman:~/.ssh$ ll | grep prac1
-r-xr-xr-x 1 abayomi abayomi 2655 Feb 18 15:55 prac1*
-rwxrwxrwx 1 abayomi abayomi 574 Feb 18 15:55 prac1.pub*
abayomi@AbayomiUsman:~/.ssh$

result for findmnt -T .

 findmnt -T .
TARGET SOURCE FSTYPE OPTIONS
/mnt/c C:\ drvfs rw,noatime,uid=1000,gid=1000,case=off

i further went to do more things like

ssh -i prac1 root@143.198.6.191
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for 'prac1' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "prac1": bad permissions
root@143.198.6.191: Permission denied (publickey).
abayomi@AbayomiUsman:~/.ssh$ ll | grep prac1
-rwxrwxrwx 1 abayomi abayomi 2655 Feb 18 15:55 prac1*
-rwxrwxrwx 1 abayomi abayomi 574 Feb 18 15:55 prac1.pub*
abayomi@AbayomiUsman:~/.ssh$ chmod -rwx prac1
chmod: prac1: new permissions are ----w--w-, not ---------
abayomi@AbayomiUsman:~/.ssh$ chmod a-rwx prac1
abayomi@AbayomiUsman:~/.ssh$ ll | grep prac1
-r-xr-xr-x 1 abayomi abayomi 2655 Feb 18 15:55 prac1*
-rwxrwxrwx 1 abayomi abayomi 574 Feb 18 15:55 prac1.pub*
abayomi@AbayomiUsman:~/.ssh$

but it still won't delete the permissions completely, i don't know why please help

This is the result after trying the solution provided on the referenced article

 chmod -rwx prac1
chmod: prac1: new permissions are ----w--w-, not ---------
abayomi@AbayomiUsman:~/.ssh$ chmod a-rwx prac1
abayomi@AbayomiUsman:~/.ssh$ ll | grep prac1
-r-xr-xr-x 1 abayomi abayomi 2655 Feb 18 15:55 prac1*
-rwxrwxrwx 1 abayomi abayomi 574 Feb 18 15:55 prac1.pub*

It still wouldn't delete all the permissions

6

2 Answers

The FSTYPE is drvfs so this looks like it is WSL on Windows.

Try changing the mount options to include fmask=111 to remove the eXecute bit.

Take a look under Mount Options here:

5

Set the permissions you want directly and be done with it.

zeus@zeus-H370M:~/test$ ls -l
total 257548
-rw-r--r-- 1 zeus zeus 31758 May 4 2020 1588603424397.JPEG
-rw-r--r-- 1 zeus zeus 274601 Mar 15 2020 Screen_Shot.png
-rw-r--r-- 1 zeus zeus 263407719 Feb 2 00:36 Test.mkv
-rw-r--r-- 1 zeus zeus 4 Feb 18 11:19 untitled.txt
zeus@zeus-H370M:~/test$ chmod 0600 *
zeus@zeus-H370M:~/test$ ls -l
total 257548
-rw------- 1 zeus zeus 31758 May 4 2020 1588603424397.JPEG
-rw------- 1 zeus zeus 274601 Mar 15 2020 Screen_Shot.png
-rw------- 1 zeus zeus 263407719 Feb 2 00:36 Test.mkv
-rw------- 1 zeus zeus 4 Feb 18 11:19 untitled.txt
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy