password locking
This commit is contained in:
parent
3121c10059
commit
b5284cc23f
|
@ -24,7 +24,10 @@ getProperties "clam" =
|
|||
, GitHome.installedFor "root"
|
||||
, check (Ssh.hasAuthorizedKeys "root") $
|
||||
Ssh.passwordAuthentication False
|
||||
, check (Ssh.hasAuthorizedKeys "root") $
|
||||
User.lockedPassword "root"
|
||||
, User.nonsystem "joey"
|
||||
, User.nuked "user"
|
||||
, Apt.installed ["sudo"]
|
||||
, fileHasContent "/etc/sudoers" ["joey ALL=(ALL:ALL) ALL"]
|
||||
, GitHome.installedFor "joey"
|
||||
|
|
|
@ -17,5 +17,18 @@ nonsystem user = check (isNothing <$> homedir user) $ cmdProperty "adduser"
|
|||
, Param user
|
||||
]
|
||||
|
||||
{- Removes user home directory!! Use with caution. -}
|
||||
nuked :: UserName -> Property
|
||||
nuked user = check (isJust <$> homedir user) $ cmdProperty "userdel"
|
||||
[ Param "-r"
|
||||
, Param user
|
||||
]
|
||||
|
||||
lockedPassword :: UserName -> Property
|
||||
lockedPassword user = cmdProperty "passwd"
|
||||
[ Param "--lock"
|
||||
, Param user
|
||||
]
|
||||
|
||||
homedir :: UserName -> IO (Maybe FilePath)
|
||||
homedir user = catchMaybeIO $ homeDirectory <$> getUserEntryForName user
|
||||
|
|
Loading…
Reference in New Issue