RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1952828 - [RFE] Allow adcli to create AD user with password as well as set or reset existing user password
Summary: [RFE] Allow adcli to create AD user with password as well as set or reset ex...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: adcli
Version: 8.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: ---
Assignee: Sumit Bose
QA Contact: shridhar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-23 10:01 UTC by shridhar
Modified: 2023-03-13 13:21 UTC (History)
3 users (show)

Fixed In Version: adcli-0.8.2-12.el8
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 19:50:53 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SSSD-3380 0 None None None 2023-03-13 13:21:43 UTC
Red Hat Product Errata RHBA-2021:4453 0 None None None 2021-11-09 19:50:58 UTC

Comment 7 shridhar 2021-06-21 09:13:09 UTC
tested with:

]# rpm -q adcli
adcli-0.8.2-12.el8.x86_64

[root@ci-vm-10-0-137- tmp.agRhcHLkkj]# adcli create-user tuser2 --verbose --domain ad.baseos.qe --display-name="tuser2 created by shridhar" --unix-uid=22222 --unix-gid=22222 --unix-home=/home/tuser2
 * Using domain name: ad.baseos.qe
 * Calculated computer account name from fqdn: CI-VM-10-0-137-
 * Calculated domain realm from name: AD.BASEOS.QE
 * Discovering domain controllers: _ldap._tcp.ad.baseos.qe
 * Sending NetLogon ping to domain controller: sec-ad1.ad.baseos.qe
 * Sending NetLogon ping to domain controller: sec-ad1.ad.baseos.qe
 * Received NetLogon info from: sec-ad1.ad.baseos.qe
 * Wrote out krb5.conf snippet to /tmp/adcli-krb5-ep4I4V/krb5.d/adcli-krb5-conf-25FIaZ
Password for Administrator.QE: 
 * Authenticated as user: Administrator.QE
 * Using GSS-SPNEGO for SASL bind
 * Looked up short domain name: AD
 * Looked up domain SID: S-1-5-21-3917357665-4280980005-1639201238
 * Found well known user container at: CN=Users,DC=ad,DC=baseos,DC=qe
 * Calculated user entry: CN=tuser2,CN=Users,DC=ad,DC=baseos,DC=qe
 * Creating user with attributes: cn, displayName, gidNumber, name, objectClass, sAMAccountName, uidNumber, unixHomeDirectory, userAccountControl, userPrincipalName
 * Created user entry: CN=tuser2,CN=Users,DC=ad,DC=baseos,DC=qe
[root@ci-vm-10-0-137- tmp.agRhcHLkkj]# ldapsearch -Y GSSAPI -h sec-ad1.ad.baseos.qe -D 'Administrator.qe' -b 'cn=users,dc=ad,dc=baseos,dc=qe' 'cn=tuser2'
SASL/GSSAPI authentication started
SASL username: ADMINISTRATOR.QE
SASL SSF: 256
SASL data security layer installed.
# extended LDIF
#
# LDAPv3
# base <cn=users,dc=ad,dc=baseos,dc=qe> with scope subtree
# filter: cn=tuser2
# requesting: ALL
#

# tuser2, Users, ad.baseos.qe
dn: CN=tuser2,CN=Users,DC=ad,DC=baseos,DC=qe
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
cn: tuser2
distinguishedName: CN=tuser2,CN=Users,DC=ad,DC=baseos,DC=qe
instanceType: 4
whenCreated: 20210621090932.0Z
whenChanged: 20210621090932.0Z
displayName: tuser2 created by shridhar
uSNCreated: 1465005
uSNChanged: 1465006
name: tuser2
objectGUID:: Y0j6v8rHm0uqxluFaJAXUA==
userAccountControl: 514
badPwdCount: 0
codePage: 0
countryCode: 0
badPasswordTime: 0
lastLogoff: 0
lastLogon: 0
pwdLastSet: 0
primaryGroupID: 513
objectSid:: AQUAAAAAAAUVAAAAYSJ+6SWSKv/WObRh/8kAAA==
accountExpires: 9223372036854775807
logonCount: 0
sAMAccountName: tuser2
sAMAccountType: 805306368
userPrincipalName: tuser2.qe
objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=ad,DC=baseos,DC=qe
dSCorePropagationData: 16010101000000.0Z
uidNumber: 22222
gidNumber: 22222
unixHomeDirectory: /home/tuser2

# search result
search: 4
result: 0 Success

# numResponses: 2
# numEntries: 1
[root@ci-vm-10-0-137- tmp.agRhcHLkkj]# 
[root@ci-vm-10-0-137- tmp.agRhcHLkkj]# 
[root@ci-vm-10-0-137- tmp.agRhcHLkkj]# adcli passwd-user tuser2 --verbose --domain ad.baseos.qe
 * Using domain name: ad.baseos.qe
 * Calculated computer account name from fqdn: CI-VM-10-0-137-
 * Calculated domain realm from name: AD.BASEOS.QE
 * Discovering domain controllers: _ldap._tcp.ad.baseos.qe
 * Sending NetLogon ping to domain controller: sec-ad1.ad.baseos.qe
 * Sending NetLogon ping to domain controller: sec-ad1.ad.baseos.qe
 * Received NetLogon info from: sec-ad1.ad.baseos.qe
 * Wrote out krb5.conf snippet to /tmp/adcli-krb5-ElFnrc/krb5.d/adcli-krb5-conf-adVQU8
Password for Administrator.QE: 
 * Authenticated as user: Administrator.QE
 * Using GSS-SPNEGO for SASL bind
 * Looked up short domain name: AD
 * Looked up domain SID: S-1-5-21-3917357665-4280980005-1639201238
Password for tuser2: 
 * Password (re)setted for user: CN=tuser2,CN=Users,DC=ad,DC=baseos,DC=qe
 * Modifying user entry attributes: userAccountControl
 * Modified user entry: CN=tuser2,CN=Users,DC=ad,DC=baseos,DC=qe
 * Enabled user entry CN=tuser2,CN=Users,DC=ad,DC=baseos,DC=qe after password (re)set

[root@ci-vm-10-0-137- tmp.agRhcHLkkj]# ldapsearch -Y GSSAPI -h sec-ad1.ad.baseos.qe -D 'Administrator.qe' -b 'cn=users,dc=ad,dc=baseos,dc=qe' 'cn=tuser2'
SASL/GSSAPI authentication started
SASL username: ADMINISTRATOR.QE
SASL SSF: 256
SASL data security layer installed.
# extended LDIF
#
# LDAPv3
# base <cn=users,dc=ad,dc=baseos,dc=qe> with scope subtree
# filter: cn=tuser2
# requesting: ALL
#

# tuser2, Users, ad.baseos.qe
dn: CN=tuser2,CN=Users,DC=ad,DC=baseos,DC=qe
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
cn: tuser2
distinguishedName: CN=tuser2,CN=Users,DC=ad,DC=baseos,DC=qe
instanceType: 4
whenCreated: 20210621090932.0Z
whenChanged: 20210621091123.0Z
displayName: tuser2 created by shridhar
uSNCreated: 1465005
uSNChanged: 1465011
name: tuser2
objectGUID:: Y0j6v8rHm0uqxluFaJAXUA==
userAccountControl: 512
badPwdCount: 0
codePage: 0
countryCode: 0
badPasswordTime: 0
lastLogoff: 0
lastLogon: 0
pwdLastSet: 132687402827368833
primaryGroupID: 513
objectSid:: AQUAAAAAAAUVAAAAYSJ+6SWSKv/WObRh/8kAAA==
accountExpires: 9223372036854775807
logonCount: 0
sAMAccountName: tuser2
sAMAccountType: 805306368
userPrincipalName: tuser2.qe
objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=ad,DC=baseos,DC=qe
dSCorePropagationData: 16010101000000.0Z
uidNumber: 22222
gidNumber: 22222
unixHomeDirectory: /home/tuser2

# search result
search: 4
result: 0 Success

# numResponses: 2
# numEntries: 1


marking verified.

Comment 9 errata-xmlrpc 2021-11-09 19:50:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (adcli bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4453


Note You need to log in before you can comment on or make changes to this bug.