Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

341
Visualizações
Ansible equivalent of "passwd -l"

I'm trying to lock a user account that I just created with Ansible (it should not be possible to log into this account). I know you can do this using the shell module by running "passwd -l".

Is there a way to do this via the user module, or something similar?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

I think that's not possible.

Maybe the following is an option?

 - user: 
     name: someone
     shell: /sbin/nologin

I think this is even more secure than using passwd -l as the latter would only disable the password. The user would still be able to login by ssh key authentication.

over 4 years ago · Santiago Trujillo Relatório

0

You can use attribute 'password_lock' password_lock: yes

^^ This is the equivalent of 'usermod -L'

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda