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: NEW --- QA Contact: shridhar <sgadekar>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.0CC: aboscatt, naresh.sukhija_ext, sgadekar
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---   
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: Type: Bug
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.