samba-tool — Main Samba administration tool.
samba-tool
[-h] [-W myworkgroup] [-U user] [-d debuglevel] [--v]
Show this help message and exit
Set the realm name
DN to use for a simple bind
Password
Username
Workgroup
Don't ask for a password
Use Kerberos
IP address of the server
level
is an integer
from 0 to 10. The default value if this parameter is
not specified is 1.
The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day-to-day running - it generates a small amount of information about operations carried out.
Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.
Note that specifying this parameter here will
override the log level parameter
in the smb.conf
file.
Prints the program version number.
The file specified contains the
configuration details required by the server. The
information in this file includes server-specific
information such as what printcap file to use, as well
as descriptions of all the services that the server is
to provide. See smb.conf
for more information.
The default configuration file name is determined at
compile time.
Base directory name for log/debug files. The extension
".progname"
will be appended (e.g. log.smbclient,
log.smbd, etc...). The log file is never removed by the client.
Set the smb.conf(5) option "<name>" to value "<value>" from the command line. This overrides compiled-in defaults and options read from the configuration file.
computername
[options]Add a new computer to the Active Directory Domain.
The new computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.
DN of alternative location (with or without domainDN counterpart) to default CN=Computers in which new computer object will be created. E.g. 'OU=OUname'.
The new computers's description.
IPv4 address for the computer's A record, or IPv6 address for AAAA record, can be provided multiple times.
Computer's Service Principal Name, can be provided multiple times.
Prepare enabled machine account for oldjoin mechanism.
computername
[options]Add a new computer. This is a synonym for the
samba-tool computer add
command and is available
for compatibility reasons only. Please use
samba-tool computer add
instead.
computername
[options]Delete an existing computer account.
The computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.
computername
Edit a computer AD object.
The computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.
Specifies the editor to use instead of the system default, or 'vi' if no system default is set.
computername
new_parent_dn
[options]This command moves a computer account into the specified organizational unit or container.
The computername specified on the command is the sAMAccountName, with or without the trailing dollar sign.
The name of the organizational unit or container can be specified as a full DN or without the domainDN component.
computername
[options]Display a computer AD object.
The computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.
Comma separated list of attributes, which will be printed.
contactname
] [options]Add a new contact to the Active Directory Domain.
The name of the new contact can be specified by the first argument 'contactname' or the --given-name, --initial and --surname arguments. If no 'contactname' is given, contact's name will be made up of the given arguments by combining the given-name, initials and surname. Each argument is optional. A dot ('.') will be appended to the initials automatically.
DN of alternative location (with or without domainDN counterpart) in which the new contact will be created. E.g. 'OU=OUname'. Default is the domain base.
The new contacts's description.
Contact's surname.
Contact's given name.
Contact's initials.
Contact's display name.
Contact's job title.
Contact's department.
Contact's company.
Contact's email address.
Contact's home page.
Contact's phone number.
Contact's mobile phone number.
Contact's office location.
contactname
] [options]Add a new contact. This is a synonym for the
samba-tool contact add
command and is available
for compatibility reasons only. Please use
samba-tool contact add
instead.
contactname
[options]Delete an existing contact.
The contactname specified on the command is the common name or the distinguished name of the contact object. The distinguished name of the contact can be specified with or without the domainDN component.
contactname
Modify a contact AD object.
The contactname specified on the command is the common name or the distinguished name of the contact object. The distinguished name of the contact can be specified with or without the domainDN component.
Specifies the editor to use instead of the system default, or 'vi' if no system default is set.
contactname
new_parent_dn
[options]This command moves a contact into the specified organizational unit or container.
The contactname specified on the command is the common name or the distinguished name of the contact object. The distinguished name of the contact can be specified with or without the domainDN component.
contactname
[options]Display a contact AD object.
The contactname specified on the command is the common name or the distinguished name of the contact object. The distinguished name of the contact can be specified with or without the domainDN component.
Comma separated list of attributes, which will be printed.
contactname
[options]Rename a contact and related attributes.
This command allows to set the contact's name related attributes. The contact's CN will be renamed automatically. The contact's new CN will be made up by combining the given-name, initials and surname. A dot ('.') will be appended to the initials automatically, if required. Use the --force-new-cn option to specify the new CN manually and --reset-cn to reset this change.
Use an empty attribute value to remove the specified attribute.
The contact name specified on the command is the CN.
New surname.
New given name.
New initials.
Specify a new CN (RDN) instead of using a combination of the given name, initials and surname.
Set the CN to the default combination of given name, initials and surname.
New display name.
New email address.
accountname
principal
[options]Add a service principal as msDS-AllowedToDelegateTo.
accountname
principal
[options]Delete a service principal as msDS-AllowedToDelegateTo.
accountname
[(on|off)] [options]Set/unset UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION (S4U2Proxy) for an account.
accountname
[(on|off)] [options]Set/unset UF_TRUSTED_FOR_DELEGATION for an account.
classic_smb_conf
Upgrade from Samba classic (NT4-like) database to Samba AD DC database.
dnsdomain
[DC|RODC] [options]Promote an existing domain member or NT4 PDC to an AD DC.
dnsdomain
[DC|RODC|MEMBER|SUBDOMAIN] [options]Join a domain as either member or backup domain controller.
pso-name
user-or-group-name
[options]Applies a PSO's password policy to a user or group.
pso-name
precedence
[options]Creates a new Password Settings Object (PSO).
pso-name
[options]Displays the Password Settings that apply to a user.
pso-name
user-or-group-name
[options]Updates a PSO to no longer apply to a user or group.
Show replication status. The [--json] option results in JSON output, and with the [--summary] option produces very little output when the replication status seems healthy.
VALUE
Modify dsheuristics directory_service configuration for the forest.
groupname
[options]Add a new AD group. This is a synonym for the
samba-tool group add
command and is available
for compatibility reasons only. Please use
samba-tool group add
instead.
groupname
Edit a group AD object.
Specifies the editor to use instead of the system default, or 'vi' if no system default is set.
groupname
[options]List all members of the specified AD group.
By default the sAMAccountNames are listed. If no sAMAccountName is available, the CN will be used instead.
List the distinguished names instead of the sAMAccountNames.
Do not list expired group members.
Do not list disabled group members.
groupname
new_parent_dn
[options]This command moves a group into the specified organizational unit or container.
The groupname specified on the command is the sAMAccountName.
The name of the organizational unit or container can be specified as a full DN or without the domainDN component.
groupname
[options]Rename a group and related attributes.
This command allows to set the group's name related attributes. The group's CN will be renamed automatically. The group's CN will be the sAMAccountName. Use the --force-new-cn option to specify the new CN manually and the --reset-cn to reset this change.
Use an empty attribute value to remove the specified attribute.
The groupname specified on the command is the sAMAccountName.
Specify a new CN (RDN) instead of using the sAMAccountName.
Set the CN to the sAMAccountName.
New mail address
New account name (sAMAccountName/logon name)
URL1
URL2
domain|configuration|schema|dnsdomain|dnsforest
[options] Compare two LDAP databases.
original-domain-SID
new-domain-SID
file
[options]Change the domain SID for ACLs. Can be used to change all entries in acl_xattr when the machine's SID has accidentally changed or the data set has been copied to another machine either via backup/restore or rsync.
Set the ACLs directly to the TDB or xattr. The POSIX permissions will NOT be changed, only the NT ACL will be stored.
Specify the name of the smb.conf service to use. This option is required in combination with the --use-s3fs option.
Set the ACLs for use with the default s3fs file server via the VFS layer. This option requires a smb.conf service, specified by the --service=SERVICE option.
Specify the xattr backend type (native fs or tdb).
Name of the tdb file where attributes are stored.
Set the ACLs for directories and their contents recursively.
Follow symlinks when --recursive is specified.
Verbosely list files and ACLs which are being processed.
ou_dn
[options]Add a new organizational unit.
The name of the organizational unit can be specified as a full DN or without the domainDN component.
Specify OU's description.
ou_dn
[options]Add a new organizational unit. This is a synonym for the
samba-tool ou add
command and is available
for compatibility reasons only. Please use
samba-tool ou add
instead.
ou_dn
[options]Delete an organizational unit.
The name of the organizational unit can be specified as a full DN or without the domainDN component.
Delete organizational unit and all children reclusively.
ou_dn
[options]List all objects in an organizational unit.
The name of the organizational unit can be specified as a full DN or without the domainDN component.
Display DNs including the base DN.
List objects recursively.
old_ou_dn
new_parent_dn
[options]Move an organizational unit.
The name of the organizational units can be specified as a full DN or without the domainDN component.
old_ou_dn
new_ou_dn
[options]Rename an organizational unit.
The name of the organizational units can be specified as a full DN or without the domainDN component.
attribute
[options]Show objectclasses that MAY or MUST contain this attribute.
username
[password
]Add a new user. This is a synonym for the
samba-tool user add
command and is available
for compatibility reasons only. Please use
samba-tool user add
instead.
username
Edit a user account AD object.
Specifies the editor to use instead of the system default, or 'vi' if no system default is set.
List all users.
By default the user's sAMAccountNames are listed.
List user's distinguished names instead of the sAMAccountNames.
Specify base DN to use. Only users under the specified base DN will be listed.
Do not list expired user accounts.
Do not list disabled user accounts.
username
[options]Display a user AD object.
Comma separated list of attributes, which will be printed.
username
new_parent_dn
[options]This command moves a user account into the specified organizational unit or container.
The username specified on the command is the sAMAccountName.
The name of the organizational unit or container can be specified as a full DN or without the domainDN component.
username
[options]Rename a user and related attributes.
This command allows to set the user's name related attributes. The user's CN will be renamed automatically. The user's new CN will be made up by combining the given-name, initials and surname. A dot ('.') will be appended to the initials automatically, if required. Use the --force-new-cn option to specify the new CN manually and --reset-cn to reset this change.
Use an empty attribute value to remove the specified attribute.
The username specified on the command is the sAMAccountName.
New surname
New given name
New initials
Specify a new CN (RDN) instead of using a combination of the given name, initials and surname.
Set the CN to the default combination of given name, initials and surname.
New display name
New email address
New account name (sAMAccountName/logon name)
New user principal name
--cache-ldb-initialize
[options]Syncs the passwords of all user accounts, using an optional script.
Note that this command should run on a single domain controller only (typically the PDC-emulator).
domain
Join and synchronise a remote AD domain to the local server.
Please note that samba-tool vampire
is deprecated,
please use samba-tool domain join
instead.
subcommand
Produce graphical representations of Samba network state. To work out what is happening in a replication graph, it is sometimes helpful to use visualisations.
There are two subcommands, two graphical modes, and (roughly) two modes of operation with respect to the location of authority.
Looks at NTDS connections.
Looks at repsTo and repsFrom objects.
Looks at replication lag as shown by the uptodateness vectors.
Distances between DCs are shown in a matrix in the terminal.
Generate Graphviz dot output (for ntdsconn and reps modes). When viewed using dot or xdot, this shows the network as a graph with DCs as vertices and connections edges. Certain types of degenerate edges are shown in different colours or line-styles.
Generate Graphviz dot output as with
[--dot] and attempt to view it
immediately using /usr/bin/xdot
.
Normally,
samba-tool
talks to one database;
with the [-r] option attempts
are made to contact all the DCs known to the first
database. This is necessary for samba-tool
visualize uptodateness
and for
samba-tool visualize reps
because
the repsFrom/To objects are not replicated, and it can
reveal replication issues in other modes.