samba-tool(8)
Main Samba administration tool.
Description
SAMBA-TOOL
NAME
samba-tool - Main Samba administration tool.
SYNOPSIS
|
samba-tool [-h] [-W myworkgroup] [-U user] [-d debuglevel] [--v] |
DESCRIPTION
This tool is part of the samba(7) suite.
OPTIONS
-h|--help
Show this help message and exit
-r|--realm=REALM
Set the realm for the domain.
Note that specifying this parameter here will override the realm parameter in the /etc/samba/smb.conf file.
--simple-bind-dn=DN
DN to use for a simple bind.
--password
Specify the password on the commandline.
Be cautious about including passwords in scripts or passing user-supplied values onto the command line. For security it is better to let the Samba client tool ask for the password if needed, or obtain the password once with kinit.
If --password is not specified, the tool will check the PASSWD environment variable, followed by PASSWD_FD which is expected to contain an open file descriptor (FD) number.
Finally it will check PASSWD_FILE (containing a file path to be opened). The file should only contain the password. Make certain that the permissions on the file restrict access from unwanted users!
While Samba will attempt to scrub the password from the process title (as seen in ps), this is after startup and so is subject to a race.
-U|--user=[DOMAIN\]USERNAME[%PASSWORD]
Sets the SMB username or username and password.
If %PASSWORD is not specified, the user will be prompted. The client will first check the USER environment variable (which is also permitted to also contain the password separated by a %), then the LOGNAME variable (which is not permitted to contain a password) and if either exists, the value is used. If these environmental variables are not found, the username found in a Kerberos Credentials cache may be used.
A third option is to use a credentials file which contains the plaintext of the username and password. This option is mainly provided for scripts where the admin does not wish to pass the credentials on the command line or via environment variables. If this method is used, make certain that the permissions on the file restrict access from unwanted users. See the -A for more details.
Be cautious about including passwords in scripts or passing user-supplied values onto the command line. For security it is better to let the Samba client tool ask for the password if needed, or obtain the password once with kinit.
While Samba will attempt to scrub the password from the process title (as seen in ps), this is after startup and so is subject to a race.
-W|--workgroup=WORKGROUP
Set the SMB domain of the username. This overrides the default domain which is the domain defined in smb.conf. If the domain specified is the same as the servers NetBIOS name, it causes the client to log on using the servers local SAM (as opposed to the Domain SAM).
Note that specifying this parameter here will override the workgroup parameter in the /etc/samba/smb.conf file.
-N|--no-pass
If specified, this parameter suppresses the normal password prompt from the client to the user. This is useful when accessing a service that does not require a password.
Unless a password is specified on the command line or this parameter is specified, the client will request a password.
If a password is specified on the command line and this option is also defined the password on the command line will be silently ignored and no password will be used.
--use-kerberos=desired|required|off
This parameter determines whether Samba client tools will try to authenticate using Kerberos. For Kerberos authentication you need to use dns names instead of IP addresses when connecting to a service.
Note that specifying this parameter here will override the client use kerberos parameter in the /etc/samba/smb.conf file.
--use-krb5-ccache=CCACHE
Specifies the credential cache location for Kerberos authentication.
This will set --use-kerberos=required too.
--ipaddress=IPADDRESS
IP address of the server
-d|--debuglevel=DEBUGLEVEL
level is an integer from 0 to 10. The default value if this parameter is not specified is 1 for client applications.
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 /etc/samba/smb.conf file.
--debug-stdout
This will redirect debug output to STDOUT. By default all clients are logging to STDERR.
COMMANDS
computer
Manage computer accounts.
computer add 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.
--computerou=COMPUTEROU
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'.
--description=DESCRIPTION
The new computers's description.
--ip-address=IP_ADDRESS_LIST
IPv4 address for the computer's A record, or IPv6 address for AAAA record, can be provided multiple times.
--service-principal-name=SERVICE_PRINCIPAL_NAME_LIST
Computer's Service Principal Name, can be provided multiple times.
--prepare-oldjoin
Prepare enabled machine account for oldjoin mechanism.
computer create 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.
computer delete computername [options]
Delete an existing computer account.
The computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.
computer edit computername
Edit a computer AD object.
The computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.
--editor=EDITOR
Specifies the editor to use instead of the system default, or 'vi' if no system default is set.
computer list
List all computers.
computer move 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.
computer show computername [options]
Display a computer AD object.
The computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.
--attributes=USER_ATTRS
Comma separated list of attributes, which will be printed.
contact
Manage contacts.
contact add [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.
--ou=OU
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.
--description=DESCRIPTION
The new contacts's description.
--surname=SURNAME
Contact's surname.
--given-name=GIVEN_NAME
Contact's given name.
--initials=INITIALS
Contact's initials.
--display-name=DISPLAY_NAME
Contact's display name.
--job-title=JOB_TITLE
Contact's job title.
--department=DEPARTMENT
Contact's department.
--company=COMPANY
Contact's company.
--mail-address=MAIL_ADDRESS
Contact's email address.
--internet-address=INTERNET_ADDRESS
Contact's home page.
--telephone-number=TELEPHONE_NUMBER
Contact's phone number.
--mobile-number=MOBILE_NUMBER
Contact's mobile phone number.
--physical-delivery-office=PHYSICAL_DELIVERY_OFFICE
Contact's office location.
contact create [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.
contact delete 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.
contact edit 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.
--editor=EDITOR
Specifies the editor to use instead of the system default, or 'vi' if no system default is set.
contact list [options]
List all contacts.
--full-dn
Display contact's full DN instead of the name.
contact move 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.
contact show 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.
--attributes=CONTACT_ATTRS
Comma separated list of attributes, which will be printed.
contact rename 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.
--surname=SURNAME
New surname.
--given-name=GIVEN_NAME
New given name.
--initials=INITIALS
New initials.
--force-new-cn=NEW_CN
Specify a new CN (RDN) instead of using a combination of the given name, initials and surname.
--reset-cn
Set the CN to the default combination of given name, initials and surname.
--display-name=DISPLAY_NAME
New display name.
--mail-address=MAIL_ADDRESS
New email address.
dbcheck
Check the local AD database for errors.
delegation
Manage Delegations.
delegation add-service accountname principal [options]
Add a service principal as msDS-AllowedToDelegateTo.
delegation del-service accountname principal [options]
Delete a service principal as msDS-AllowedToDelegateTo.
delegation for-any-protocol accountname [(on|off)] [options]
Set/unset UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION (S4U2Proxy) for an account.
delegation for-any-service accountname [(on|off)] [options]
Set/unset UF_TRUSTED_FOR_DELEGATION for an account.