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=offi 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
62 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:
5Set 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 More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"