简体   繁体   中英

Users created to Ubuntu by Puppet cannot connect by SSH

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?

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'],
        }
     }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM