Question

I am trying to add new user to Ubuntu Server 14.04 with the latest version Puppet.

I use the following code:

 user { 'user':
            ensure => present,
            home => '/home/user',
            managehome => true,
            password => 'password',
            system => true,
            shell =>  '/bin/bash',
            require => Group['usergroup'],
    }

The user gets created successfully but cannot log in with SSH.

This is what I get when trying to SSH:

user@10.11.11.11's password:
debug3: packet_send2: adding 64 (len 54 padlen 10 extra_pad 64)
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.

Problem should not be about allowing users to use SSH because user created with adduser can log in with SSH without problems. Also all existing user can SSH in.

What could be causing this problem?

Was it helpful?

Solution

the password in puppet should be in encrypted format

for example:

  class adminusers {
     group { 'mygroup':
            ensure => 'present',
            gid    => '900',
       }

      user { 'pippo':
            ensure   => 'present',
            gid      => '100',
            home     => '/home/pippo',
            shell    => '/bin/bash',
            uid      => '150',
            managehome => true,
            groups => ['mygroup'],
            password => '$1$WhUZgOHI$OerslOWA3aeZfRjemFsvl/',
            require => Group['mygroup'],
        }
     }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top