How can I remove permissions for all users except myself using `icacls`?

To remove permissions for all users except yourself, you can use icacls with a wildcard for users, but exclude your own username.
Here's how to do it:

  1. First, remove all other users' permissions:

    icacls "C:\tools\shell\home\.ssh" /remove * /t
    
  2. Then, restore full control to your user:

    icacls "C:\tools\shell\home\.ssh" /grant dmitrii:F /t
    

This approach removes permissions for all users and then reassigns full control to you.