Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
List archives

Creating user with random password (only once)

Re: Re: Newbie: Confused about where to start managing users...
(130 lines)
Why are not the reports uploading?
(27 lines)
Feb 8, 2012
Wernerbahlke
Wernerbahlke
Hi,

I want to create a user with a random password. Is there a way to only
execute the manifest once when the user does not exist but not once
the user is created?

I know how to create a random password and can use generate to execute
this function (or make it a custom fact provided I get this fact
executed).

So far I call an add_user method define in a users module out of my
base class. Here is the code:

  include users

  users::add_user { 'testuser':
    name     => 'testuser',
    uid      => '777',
    password => generate('/usr/local/bin/new_hash'),
    shell    => '/bin/csh',
    groups   => 'testuser',
  }

But alas this will get executed every time the client runs since the
password will have changed due to the new generate call.

One work-around I could think of is to create the user on the client
(FreeBSD) using an exec calling the makepassword and pw command.

Then I could check for existance of the user in the masterpasswd file
with an unless check.

But I much prefer do this with Puppet natively.

Any suggestions will be greatly appreciated.

Werner





Reply
Tags: random password
Messages in this thread
Creating user with random password (only once)
(puppetlabs/puppet) New pull request: (#11717) Modified user create to save password while creating
January 4, 2012 09:16:08 AM
Please review pull request #303:(#11717) Modified user create to save password while creating windows user [Link: https://github.com/puppetlabs/puppet/pull/303 ] opened by (ptinsley) Description: Required fix for boxes that have a…
creating utf-8 random strings
December 25, 2011 09:18:03 AM
Hi list, In order to make tests I must create strings [20-32] & [32-64] characters long with accentuated characters. I use a very old piece of code (not even accurated, but sufficient until now), however it don't give me lower-case nor…
Re: Creating Users and Hashing it's password.
June 12, 2011 02:58:20 PM
On Ubuntu/Debian, you can generate the hash using: mkpasswd -m sha-512 I don't know if it works on Mac, but the output of it looks like the same as the examples posted on this topic, so I think it should work.* *
Creating Users and Hashing it's password.
June 8, 2011 02:09:22 PM
Hi everyone I would like to first of all say thanks to anyone willing to help me. I was tasked with creating a Admin account using puppet to push to all of our Macs that we have deployed around the Campus. user {'sysop': #uid …
Created] (AMQ-3509) Add the user name in the "User name or password is invalid" error line
September 23, 2011 03:50:51 AM
Add the user name in the "User name or password is invalid" error line
Can't change user password
July 7, 2010 09:51:51 AM
I tried on Archiva-1.2.2 and Archiva-1.3.1, both failed to change: HTTP Status 500 - type Exception report message descriptionThe server encountered an internal error () that prevented it from fulfilling this request. exception …
User/Password management in 2.6
July 27, 2010 07:17:49 AM
Hey there, I recently updated to 2.6. Part of puppet's assignment is to manage users and their passwords. Since the update every puppetrun reports that passwords for every user were created although they've already been set in previous runs. …
new install, can't use - need password for postgres user
August 12, 2011 03:52:51 AM
I have just completed a first installation on Windows 2008 Server. I was very keen to work with PostGreSQL. I can't even do the basic things in pgAdmin III that I installed with the database, as I don't have a password and the documentation doesn't…
how to set the user (sudoer) password as a parameter ?
April 18, 2011 12:44:58 AM
executing the deployment I am asked each time the password in the console : .. * executing "sudo -p 'sudo password: ' chmod -R +x /var/www/vhosts/ seveacademy.com/rails/testsbga/current/log Password: Q1 : what should I change in my deploy.rb to…
javax.jms.JMSException: User name or password is invalid.
March 23, 2011 02:47:08 AM
Hi, Active MQ 5.1 Jmeter 2.4 JMS publisher. When using username/password for the JMS it complains about wrong username and password. It is the same credentials as specified in ActiveMQ. I have the credential in a jndi,prporties file as a jar in…
block user and password change policy
August 4, 2010 04:14:17 AM
hi, i'm trying to implement these charecteristics: - block a user after 5 wrong passwords - force the user to change the password after a number of days i've a full java application in front of the repository, so i don't need to implement every…
Re: javax.jms.JMSException: User name or password is invalid.
March 23, 2011 02:48:02 AM
Thank you for your message. I will be unavailable until Tuesday March 29th. If you have any questions or need immediate attention please contact supp### @conceptual.ca or call 519.273.3377 I took the money and ran ;) Dan Heitbohmer
REST - Securing Queues with user / password ?
January 23, 2011 11:42:52 PM
there´s a way to secure access to each Q in broker (user/pass) using REST interface? Case: - 2 clients A and B - one Q for each one: QA and QB - I don´t what A to see QB messages (same for B and QA), so I choose to use user/pass auth theres any…
Can't get user:password@domain auth to work...
November 8, 2010 12:25:26 AM
I've been trying to use the user:pass### @domain method for doing admin actions, but it doesn't seem to work. I get a response like this: 1> [info] [<0.10652.0>] 127.0.0.1 - - 'PUT' /hello 302 1> [debug] [<0.10654.0>] 'PUT'…
couchdb on OS X asks for user/password when using curl
August 14, 2010 07:23:47 PM
Today I installed couchdb on OS X (Snow Leopard) via MacPorts. I started couchdb and can connect to via the web browser (http://127.0.0.1:5984/). I got the expected result: "{"couchdb":"Welcome","version":"1.0.0"}" But when I try to connect via…
Updated: (AMQ-2402) SystemPropertiesConfiguration swaps JMX user / password
September 18, 2010 11:48:12 AM
[ https://issues.apache.org/activemq/browse/AMQ-2402?page=com.atlassian. jira.plugin.system.issuetabpanels:all-tabpanel ] Bruce Snyder updated AMQ-2402:
Updated: (AMQ-2402) SystemPropertiesConfiguration swaps JMX user / password
December 2, 2010 07:12:30 AM
[ https://issues.apache.org/jira/browse/AMQ-2402?page=com.atlassian.jira .plugin.system.issuetabpanels:all-tabpanel ] Dejan Bosanac updated AMQ-2402:
Hosting the user password only, not the .bashrc and -bash_profile files
December 19, 2011 05:49:20 AM
Hi all, We have a number of server on which user "admin" exists, and that have manual modifications to its bashrc and bash_profile files. What I'd like to do is to host its user password from puppet master, but not the bash-files. I tries this…
Does JMeter record user name and password for HTTPs request...
September 10, 2010 11:55:42 PM
Well, This question is in continuation of one of my initial query, but since it is tangential I am filing it as a different question. I have an app which on launch changes from http to https (here login happens) and after logging in it again…
Resolved: (AMQ-2402) SystemPropertiesConfiguration swaps JMX user / password
March 7, 2011 04:09:22 PM
[ https://issues.apache.org/jira/browse/AMQ-2402?page=com.atlassian.jira .plugin.system.issuetabpanels:all-tabpanel ] Timothy Bish resolved AMQ-2402.
"Access denied for user 'root'@'servername' (using password: NO)" - except I AM using a password
April 25, 2011
This is weird. Our web server is running RHEL 5.5, and has the MySQL client version 5.5.10 installed (just updated from a 5.0 build, which was…
How to change UNIX user password using passwd if user is stored in a MySQL database?
April 14, 2011
I'm trying to setup libnss-mysql and libpam-mysql . So far everything has been working. I can use id to get information about the users stored in my…
How to update the user profile through tokenid when a particular user logs in using his username and password
June 24, 2011
I have an application in which when the user enters his username and password in the login form , his username and password are submitted to the…
Cannot connect: Access denied for user '[user]'@'localhost' (using password: YES)
March 10, 2011
I'm trying to install a PHP-based tool which connects to a MySQL database, hosted on Ubuntu. I can log into the MySQL database from the command…
MySQL - creating an SQL Algorithm to determine random 'popular' content
April 4, 2011
Hi folks, I'm looking to create an SQL query (in MySQL) that will display 6 random, yet popular entries in my web application. My database has the…
Should each user get his own database user/password when they use a single app?
May 12, 2011
What I am trying to ask is ... Users will only ever access the database via my application. The application itself allows an admin user to…
Pull a random ID from a mysql table that a particular user has not seen before
March 21, 2011
Using mysql and PHP, I'd like to setup a query which pulls a problem from the problems table which a particular user has not seen yet. I have two…
Creating a secure, web-based password management system with the ability to share data between users
March 27, 2011
I apologize in advance for the incoming Wall-O-Text . This is (at least, to me) a fairly complex issue that I've put quite a bit of thought into.…
Recover password- user
March 20, 2011
hello i have a simple doubt. How is the best way to do a recover password for an user? something like "forget your password?" and when click, user…
How can I set a password for user in MySQL
March 10, 2011
I need a password for an user as Drupal's installation asks that. I'm totally newcomer on creating databases so I tried this: CREATE DATABASE…
Error in mysql user password
March 5, 2011
I am using Ubuntu 10.10 and I installed phpmyadmin from synaptic package manager. But i did not put any password on mysql root user and phpmyadmin…
SSH without password doesn't work with user postgres
April 4, 2011
I've tried manually adding the pub key to authorized_keys and authorized_keys2. I've also double checked the permissions on .ssh (700) and…
Git clone using http with user and password
May 17, 2011
I try to use git clone http://user:password@host.com but I have some problems with adding user or password because the user is using email which…
Setting password for Django user
May 25, 2011
Hello, I'm running Django and trying to create a superuser but I keep getting the following error whenever I try execute a passwd or createsuperuser…
"User Expired Password" in JDBCRealm
March 30, 2011
How to use "User Expired Password" in JDBCRealm ? Is it able to do this ?
Set blank password for PostgreSQL user
March 24, 2011
Hi, i use postgresql command 'createuser myusername' . it prompts me for password always. if i leave password blank . it gives an error that no…
Setting the mysql root user password on mac
June 24, 2011
I just Install MySQL on Mac OS X. The next step was setting the root user password, do I did the next: 1-Launch the terminal app to access the unix…
Minimum SSL Certificate Key for user name and password site?
June 5, 2011
Just heard a podcast that claimed the SSL was broken for small key sizes. They said that you should use as strong a key as you can afford, without…
Preventing postgresql commands from keep asking for user password
March 11, 2011
It's strange, but i've searched around for this source of configuration but couldnt find it out. Im currently using opensuse 11.3 with postgresql 9.…
How to serve GIT through HTTP via NGINX with user/password?
June 20, 2011
Despite all the links I've found on how to configure git/nginx to get my repos, I can't make them work. I followed this tutorial, Git repository…