chnaging all passwords on linux box

40 views
Skip to first unread message

Andrew Morgan

unread,
Aug 30, 2019, 2:19:52 AM8/30/19
to Ansible Project
Hello All,

I have a task to change all the password on a vpnbox and then give the user their password. I have been researching and think I found a way to do it, but I am not sure how I then get the password to output to a file to then give the user. Is there a way I can go about doing that? After assigning a password, out the password that was assigned and the user's name to a file.

Thank you 

Dick Visser

unread,
Aug 30, 2019, 2:33:20 AM8/30/19
to ansible...@googlegroups.com
It depends on what your vpn box looks like and how easy it is to change passwords on it.
You can loop over the users changing their password to a random value and then writing those to files named after the user name. 
This is just one way of doing it- there are probably more. 

But whatever you come up with, as an affected user I wouldn’t be very happy if someone else sets a password for me and then copies that around in plain text files. 
You can try to secure this but ultimately it’s best to offer a secure way for users to do this themselves. Or have the vpn box authenticate users to some existing directory (both of which might not be possible, depending on your situation). 

Dick


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5795afb5-a59d-421d-91a2-6b5a645a2c56%40googlegroups.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

Andrew Morgan

unread,
Aug 30, 2019, 12:59:00 PM8/30/19
to Ansible Project
Thank you for your answer. The vpn box is a simple openvpn server, so changing the linux users password is simple. I think I am having issues with how to export those values(username and associated) password to a file. Is there an example of this you can point me toward? I am not seeing any online.

Thank you 


On Friday, 30 August 2019 02:33:20 UTC-4, Dick Visser wrote:
It depends on what your vpn box looks like and how easy it is to change passwords on it.
You can loop over the users changing their password to a random value and then writing those to files named after the user name. 
This is just one way of doing it- there are probably more. 

But whatever you come up with, as an affected user I wouldn’t be very happy if someone else sets a password for me and then copies that around in plain text files. 
You can try to secure this but ultimately it’s best to offer a secure way for users to do this themselves. Or have the vpn box authenticate users to some existing directory (both of which might not be possible, depending on your situation). 

Dick

On Fri, 30 Aug 2019 at 08:20, Andrew Morgan <alonso...@gmail.com> wrote:
Hello All,

I have a task to change all the password on a vpnbox and then give the user their password. I have been researching and think I found a way to do it, but I am not sure how I then get the password to output to a file to then give the user. Is there a way I can go about doing that? After assigning a password, out the password that was assigned and the user's name to a file.

Thank you 

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.

Cade Lambert

unread,
Aug 30, 2019, 1:27:35 PM8/30/19
to Ansible Project
I think you should run through how you want it to work.  Do you want it to output a file to a server?  A workstation? Shared storage? Are you emailing the file to the user?

If your intent is to email that file to a user, you could just use the email module and include the password variable in the body of the email.

Stefan Hornburg (Racke)

unread,
Aug 31, 2019, 3:31:14 AM8/31/19
to ansible...@googlegroups.com
On 8/30/19 6:59 PM, Andrew Morgan wrote:
> Thank you for your answer. The vpn box is a simple openvpn server, so changing the linux users password is simple. I
> think I am having issues with how to export those values(username and associated) password to a file. Is there an
> example of this you can point me toward? I am not seeing any online.
>
> Thank you

Hello Andrew,

I would do it the other way around - set up a YAML file with the usernames and passwords on the Ansible controller
and change the passwords based on that. The YAML file should be encrypted with Ansible vault for security.

Regards
Racke

>
> On Friday, 30 August 2019 02:33:20 UTC-4, Dick Visser wrote:
>
> It depends on what your vpn box looks like and how easy it is to change passwords on it.
> You can loop over the users changing their password to a random value and then writing those to files named after
> the user name. 
> This is just one way of doing it- there are probably more. 
>
> But whatever you come up with, as an affected user I wouldn’t be very happy if someone else sets a password for me
> and then copies that around in plain text files. 
> You can try to secure this but ultimately it’s best to offer a secure way for users to do this themselves. Or have
> the vpn box authenticate users to some existing directory (both of which might not be possible, depending on your
> situation). 
>
> Dick
>
>
> On Fri, 30 Aug 2019 at 08:20, Andrew Morgan <alonso...@gmail.com <javascript:>> wrote:
>
> Hello All,
>
> I have a task to change all the password on a vpnbox and then give the user their password. I have been
> researching and think I found a way to do it, but I am not sure how I then get the password to output to a file
> to then give the user. Is there a way I can go about doing that? After assigning a password, out the password
> that was assigned and the user's name to a file.
>
> Thank you 
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com
> <javascript:>.
> <https://groups.google.com/d/msgid/ansible-project/5795afb5-a59d-421d-91a2-6b5a645a2c56%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> Sent from a mobile device - please excuse the brevity, spelling and punctuation.
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/4c5e0a70-5619-4f0d-854c-b11cfa26d26c%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/4c5e0a70-5619-4f0d-854c-b11cfa26d26c%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

signature.asc

Andrew Morgan

unread,
Aug 31, 2019, 3:27:55 PM8/31/19
to Ansible Project
Thank you , that is a very good suggestion.I will do it that way and report back if I need help.

Regards,
Andrew
Reply all
Reply to author
Forward
0 new messages