Merge pull request #99520 from endgame/ssm-agent-user-fix
ssm-agent: fix bad user declaration
This commit is contained in:
commit
6ee8491cb1
@ -29,8 +29,6 @@ in {
|
|||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
systemd.services.ssm-agent = {
|
systemd.services.ssm-agent = {
|
||||||
users.extraUsers.ssm-user = {};
|
|
||||||
|
|
||||||
inherit (cfg.package.meta) description;
|
inherit (cfg.package.meta) description;
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
@ -43,5 +41,26 @@ in {
|
|||||||
RestartSec = "15min";
|
RestartSec = "15min";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Add user that Session Manager needs, and give it sudo.
|
||||||
|
# This is consistent with Amazon Linux 2 images.
|
||||||
|
security.sudo.extraRules = [
|
||||||
|
{
|
||||||
|
users = [ "ssm-user" ];
|
||||||
|
commands = [
|
||||||
|
{
|
||||||
|
command = "ALL";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
# On Amazon Linux 2 images, the ssm-user user is pretty much a
|
||||||
|
# normal user with its own group. We do the same.
|
||||||
|
users.groups.ssm-user = {};
|
||||||
|
users.users.ssm-user = {
|
||||||
|
isNormalUser = true;
|
||||||
|
group = "ssm-user";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user