Skip to content

Commit

Permalink
home/user: list ssh perm commands
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Nov 14, 2024
1 parent 4a9c776 commit fa64f32
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/home/user/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ in
# Cryptography
genpass = "${getExe pkgs.openssl} rand - base64 20"; # Generate a random, 20-charactered password
sha = "shasum -a 256"; # Test checksum
ssh-list-perm-user = ''find ~/.ssh -exec stat -c "%a %n" {} \;'';
sshperm-user = # bash
''${getExe' pkgs.findutils "find"} ~/.ssh/ -type f -exec chmod 600 {} \;; ${getExe' pkgs.findutils "find"} ~/.ssh/ -type d -exec chmod 700 {} \;; ${getExe' pkgs.findutils "find"} ~/.ssh/ -type f -name "*.pub" -exec chmod 644 {} \;'';
ssh-list-perm-system = ''find /etc/ssh -exec stat -c "%a %n" {} \;'';
sshperm-system = # bash
''sudo ${getExe' pkgs.findutils "find"} /etc/ssh/ -type f -exec chmod 600 {} \;; sudo ${getExe' pkgs.findutils "find"} /etc/ssh/ -type d -exec chmod 700 {} \;;sudo ${getExe' pkgs.findutils "find"} /etc/ssh/ -type f -name "*.pub" -exec chmod 644 {} \;'';
};
Expand Down

0 comments on commit fa64f32

Please sign in to comment.