1
 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 [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         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
[email protected]: 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

5
  • Can you edit your question to include the output of findmnt -T . run from the same (.ssh) directory please? Feb 19, 2021 at 0:06
  • Indeed you are thinking a fat32 partition, never gave that one a thought until now...
    – user1179897
    Feb 19, 2021 at 0:10
  • @steeldriver i just did that you should see it now thank you Feb 19, 2021 at 8:26
  • @muru no it doesn't i have tried it i'll post the result now all the permissions were not deleted i don't know why Feb 19, 2021 at 8:55
  • I guess ubuntu decided to represent it like that cause they're the same here is the result trying to act on the * chmod -rwx prac1* chmod: prac1.pub: new permissions are ----w--w-, not --------- abayomi@AbayomiUsman:~/.ssh$ ll | grep prac1* abayomi@AbayomiUsman:~/.ssh$ Feb 19, 2021 at 9:01

2 Answers 2

4

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:

https://devblogs.microsoft.com/commandline/chmod-chown-wsl-improvements/

5
  • Thank you so much Chris Taylor i'm really grateful it has worked i have been able to log into my server thank you so much GOD bless you i only needed to set that fmask option to 111 and all the x permissions went off and i was able to give only me access to the file thank you so much it has worked Feb 19, 2021 at 10:34
  • Thank you so much it woked i've been able to delete rwx from all other users leaving only me using chmod 700 after i set the mount option fmask to 111. Thank you so much! Feb 19, 2021 at 10:40
  • @AbayomiUsman if this answer solved your issue, please consider accepting it Feb 19, 2021 at 12:29
  • @steeldriver I have already or is there way to indicate that on this platform? Feb 20, 2021 at 15:06
  • @AbayomiUsman see How do I “accept” an answer? Feb 20, 2021 at 15:45
1

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
  • it did not work the write and execute permissions refuse to delete Feb 19, 2021 at 8:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .