summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2014-03-30 01:49:11 -0400
committerJoey Hess2014-03-30 01:49:11 -0400
commitc0bc3815ac6044dfe3f587c34d581dc74087a10e (patch)
tree95216691a7ceeab01072880be2c5351b862ad0da
parent1e045b67b9cb8bf60019f0c72279e2be438db72d (diff)
fix ssh config
-rw-r--r--HostProp.hs1
-rw-r--r--Property/Ssh.hs5
2 files changed, 4 insertions, 2 deletions
diff --git a/HostProp.hs b/HostProp.hs
index 25120e27..84ae934f 100644
--- a/HostProp.hs
+++ b/HostProp.hs
@@ -32,6 +32,7 @@ getProperties "clam.kitenet.net" =
Ssh.passwordAuthentication False
, check (Ssh.hasAuthorizedKeys "root") $
User.lockedPassword "root"
+ , Apt.installed ["vim"]
, User.nonsystem "joey"
, Apt.installed ["sudo"]
, lineInFile "/etc/sudoers" "joey ALL=(ALL:ALL) ALL"
diff --git a/Property/Ssh.hs b/Property/Ssh.hs
index c5902d94..3883606b 100644
--- a/Property/Ssh.hs
+++ b/Property/Ssh.hs
@@ -18,11 +18,12 @@ sshdConfig = "/etc/ssh/sshd_config"
setSshdConfig :: String -> Bool -> Property
setSshdConfig setting allowed = combineProperties desc
- [ lineNotInFile sshdConfig (setting ++ sshBool (not allowed))
- , lineInFile sshdConfig (setting ++ sshBool allowed)
+ [ lineNotInFile sshdConfig $ sshLine (not allowed)
+ , lineInFile sshdConfig $ sshLine allowed
] `onChange` restartSshd
where
desc = unwords [ "ssh config:", setting, sshBool allowed ]
+ sshline v = setting ++ " " ++ sshBool v
permitRootLogin :: Bool -> Property
permitRootLogin = setSshdConfig "PermitRootLogin"