mirror of
https://github.com/samba-team/samba.git
synced 2025-07-04 00:59:13 +03:00
samba-tool: moved export to domain dumpkeys
This is part of the samba-tool work to fit the object-action model Signed-off-by: Andrew Tridgell <tridge@samba.org>
This commit is contained in:
committed by
Andrew Tridgell
parent
eb259a676d
commit
c049b14dc1
@ -27,6 +27,7 @@ import samba.getopt as options
|
||||
import ldb
|
||||
import os
|
||||
from samba import Ldb
|
||||
from samba.net import Net
|
||||
from samba.auth import system_session
|
||||
from samba.samdb import SamDB
|
||||
from samba.dcerpc.samr import DOMAIN_PASSWORD_COMPLEX, DOMAIN_PASSWORD_STORE_CLEARTEXT
|
||||
@ -47,6 +48,27 @@ from samba.dsdb import (
|
||||
|
||||
|
||||
|
||||
class cmd_domain_dumpkeys(Command):
|
||||
"""Dumps kerberos keys of the domain into a keytab"""
|
||||
synopsis = "%prog domain dumpkeys <keytab>"
|
||||
|
||||
takes_optiongroups = {
|
||||
"sambaopts": options.SambaOptions,
|
||||
"credopts": options.CredentialsOptions,
|
||||
"versionopts": options.VersionOptions,
|
||||
}
|
||||
|
||||
takes_options = [
|
||||
]
|
||||
|
||||
takes_args = ["keytab"]
|
||||
|
||||
def run(self, keytab, credopts=None, sambaopts=None, versionopts=None):
|
||||
lp = sambaopts.get_loadparm()
|
||||
net = Net(None, lp, server=credopts.ipaddress)
|
||||
net.export_keytab(keytab=keytab)
|
||||
|
||||
|
||||
|
||||
class cmd_domain_level(Command):
|
||||
"""Raises domain and forest function levels"""
|
||||
@ -444,6 +466,7 @@ class cmd_domain(SuperCommand):
|
||||
"""Domain management"""
|
||||
|
||||
subcommands = {}
|
||||
subcommands["dumpkeys"] = cmd_domain_dumpkeys()
|
||||
subcommands["level"] = cmd_domain_level()
|
||||
subcommands["machinepassword"] = cmd_domain_machinepassword()
|
||||
subcommands["passwordsettings"] = cmd_domain_passwordsettings()
|
||||
|
Reference in New Issue
Block a user