Bug 2220841

Summary: `# realm leave --remove` command should not ask for credentials if a valid kerberos ticket is present.
Product: Red Hat Enterprise Linux 8 Reporter: pdoiphod
Component: realmdAssignee: Sumit Bose <sbose>
Status: CLOSED MIGRATED QA Contact: shridhar <sgadekar>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.0CC: aboscatt, naresh.sukhija_ext, sgadekar
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-19 14:06:04 UTC Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description pdoiphod 2023-07-06 09:21:55 UTC
Description of problem:

When we use --remove option with realm leave, it also deletes computer account from AD. With just realm leave it does not.
1. When we use realm leave --remove it asks for Admin user credentials.
So the requirement here is if I have a valid kerberos ticket, then it should use that ticket to remove system from AD domain and should not ask for credentials.
2. The above scenario works with realm join as its possible to join the domain without credentials if we have a valid kerberos ticket. This should work for realm leave --remove as well.


Version-Release number of selected component (if applicable):


How reproducible:
[Always]


Steps to Reproduce:
1. # realm leave --remove

Actual results:
# realm --remove leave
Password for Administrator: 

Expected results:
# realm --remove leave
#

[It should leave domain without asking for Admin credentials if a valid kerberos ticket is present]

Additional info:
[NA]

Comment 2 naresh.sukhija_ext 2023-07-10 06:39:32 UTC
Also, in case the user is specified with "-U" there needs to be a provision to check the kerberos token for that user instead of Admin user.

Comment 3 RHEL Program Management 2023-09-19 14:02:08 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 4 RHEL Program Management 2023-09-19 14:06:04 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.