fix ssh config
This commit is contained in:
parent
1e045b67b9
commit
c0bc3815ac
|
@ -32,6 +32,7 @@ getProperties "clam.kitenet.net" =
|
||||||
Ssh.passwordAuthentication False
|
Ssh.passwordAuthentication False
|
||||||
, check (Ssh.hasAuthorizedKeys "root") $
|
, check (Ssh.hasAuthorizedKeys "root") $
|
||||||
User.lockedPassword "root"
|
User.lockedPassword "root"
|
||||||
|
, Apt.installed ["vim"]
|
||||||
, User.nonsystem "joey"
|
, User.nonsystem "joey"
|
||||||
, Apt.installed ["sudo"]
|
, Apt.installed ["sudo"]
|
||||||
, lineInFile "/etc/sudoers" "joey ALL=(ALL:ALL) ALL"
|
, lineInFile "/etc/sudoers" "joey ALL=(ALL:ALL) ALL"
|
||||||
|
|
|
@ -18,11 +18,12 @@ sshdConfig = "/etc/ssh/sshd_config"
|
||||||
|
|
||||||
setSshdConfig :: String -> Bool -> Property
|
setSshdConfig :: String -> Bool -> Property
|
||||||
setSshdConfig setting allowed = combineProperties desc
|
setSshdConfig setting allowed = combineProperties desc
|
||||||
[ lineNotInFile sshdConfig (setting ++ sshBool (not allowed))
|
[ lineNotInFile sshdConfig $ sshLine (not allowed)
|
||||||
, lineInFile sshdConfig (setting ++ sshBool allowed)
|
, lineInFile sshdConfig $ sshLine allowed
|
||||||
] `onChange` restartSshd
|
] `onChange` restartSshd
|
||||||
where
|
where
|
||||||
desc = unwords [ "ssh config:", setting, sshBool allowed ]
|
desc = unwords [ "ssh config:", setting, sshBool allowed ]
|
||||||
|
sshline v = setting ++ " " ++ sshBool v
|
||||||
|
|
||||||
permitRootLogin :: Bool -> Property
|
permitRootLogin :: Bool -> Property
|
||||||
permitRootLogin = setSshdConfig "PermitRootLogin"
|
permitRootLogin = setSshdConfig "PermitRootLogin"
|
||||||
|
|
Loading…
Reference in New Issue