SMBADM(8) | Maintenance Commands and Procedures | SMBADM(8) |
smbadm
— configure
and manage SMB local groups and users, and manage domain
membership
smbadm |
create [-d
description] group |
smbadm |
delete group |
smbadm |
rename group
new-group |
smbadm |
show [-mp ]
[group] |
smbadm |
get [-p
property]... group |
smbadm |
set -p
property=value
[-p
property=value]...
group |
smbadm |
add-member -m
member [-m
member]... group |
smbadm |
remove-member -m
member [-m
member]... group |
smbadm |
delete-user username |
smbadm |
disable-user username |
smbadm |
enable-user username |
smbadm |
join [-y ]
[-c container]
-u username
domain |
smbadm |
join [-y ]
-w workgroup |
smbadm |
lookup account-name
[account-name]... |
smbadm |
list |
smbadm |
list-domains |
smbadm |
list-sessions [-p ]
[-o field,...] |
smbadm |
list-trees [-p ]
[-o field,...] |
smbadm |
list-ofiles [-p ]
[-o field,...] |
smbadm |
close-session client_name
[user_name] |
smbadm |
close-ofile file_ID |
The smbadm
command is used to configure
SMB local groups and users, and to manage domain membership. You can also
use the smbadm
command to enable or disable SMB
password generation for individual local users.
SMB local groups can be used when Windows accounts must be members of some local groups and when Windows style privileges must be granted. System local groups cannot provide these functions.
There are two types of local groups: user defined and built-in. Built-in local groups are predefined local groups to support common administration tasks.
In order to provide proper identity mapping between SMB local groups and system groups, a SMB local group must have a corresponding system group. This requirement has two consequences: first, the group name must conform to the intersection of the Windows and system group name rules. Thus, a SMB local group name can be up to eight (8) characters long and contain only lowercase characters and numbers. Second, a system local group has to be created before a SMB local group can be created.
Built-in groups are standard Windows groups and are predefined by the SMB service. The built-in groups cannot be added, removed, or renamed, and these groups do not follow the SMB local group naming conventions.
When the SMB server is started, the following built-in groups are available:
System local users must have an SMB password for authentication and to gain access to SMB resources. This password is created by using the passwd(1) command when the pam_smb_password module is added to the system's PAM configuration. See the pam_smb_passwd(7) man page.
The disable-user
and
enable-user
subcommands control SMB
password-generation for a specified local user. When disabled, the user is
prevented from connecting to the SMB service. By default, SMB
password-generation is enabled for all local users.
To reenable a disabled user, you must use the
enable-user
subcommand and then reset the user's
password by using the passwd
command. The
pam_smb_passwd.so.1 module must be added to the
system's PAM configuration to generate an SMB password.
For the add-member
,
remove-member
, and join
(with -u
) subcommands, the backslash character
("\") is a valid separator between member or user names and domain
names. The backslash character is a shell special character and must be
quoted. For example, you might escape the backslash character with another
backslash character:
domain\\username. For more
information about handling shell special characters, see the man page for
your shell.
The smbadm
command uses the following
operands:
The smbadm
command includes these
subcommands:
create
[-d
description]
group-d
option.delete
grouprename
group new-groupshow
[-mps
] [group]-m
option is specified, the group members are also
shown. If the -p
option is specified, the group
privileges are also shown. If the -s
option is
specified, group members are listed as SIDs instead of names.get
[-p
property=value]...
groupset
-p
property=value
[-p
property=value]...
groupThe -p
property=value option
specifies the list of properties to be set on the specified group.
The group-related properties are as follows:
backup
=on
|off
description
=description-textrestore
=on
|off
take-ownership
=on
|off
bypass-read
=on
|off
bypass-write
=on
|off
add-member
-m
member
[-m
member]...
group-m
member option specifies
the name of a SMB local group member. The member name must include an
existing user name and an optional domain name.
Specify the member name in either of the following formats:
[domain\]username [domain/]username
For example, a valid member name might be sales\terry or sales/terry, where sales is the Windows domain name and terry is the name of a user in the sales domain.
remove-member
-m
member
[-m
member]...
group-m
member option specifies
the name of a SMB local group member. The member name must include an
existing user name and an optional domain name.
Specify the member name in either of the following formats:
[domain\]username [domain/]username
For example, a valid member name might be sales\terry or sales/terry, where sales is the Windows domain name and terry is the name of a user in the sales domain.
delete-user
usernamepasswd
command to create the SMB password and re-enable access.disable-user
usernamepasswd
command to modify the user's SMB password
until the user account is re-enabled.enable-user
usernamepasswd
command to generate the
SMB password for the local user.
The passwd
command manages both the
system password and SMB password for this user if the
pam_smb_passwd module has been added to the
system's PAM configuration.
join
[-y
] [-c
container] -u
username domainAn authenticated user account is required to join a domain, so
you must specify the Windows administrative user name with the
-u
option. If the password is not specified on
the command line, the user is prompted for it. This user should be the
domain administrator or any user who has administrative privileges for
the target domain.
username and domain can be entered in any of the following formats:
username[+password] domain domain\username[+password] domain/username[+password] username@domain
...where domain can be the NetBIOS or DNS domain name.
The optional container string specifies the Relative Distinguished Name (RDN) of the Active Directory Container in which the machine trust account should be created. If unspecified, the RDN used is:
CN=Computers
If a machine trust account for the system already
exists on a domain controller, any authenticated user account can be
used when joining the domain. However, if the machine trust account does
not already
exist, an account that has administrative privileges on the domain is
required to join the domain. Specifying -y
will
bypass the SMB service restart prompt.
join
[-y
] -w
workgroupThe default mode for the SMB service is workgroup mode, which uses the default workgroup name, "WORKGROUP".
The -w
workgroup
option specifies the name of the workgroup to join when using the
join
subcommand. Specifying
-y
will bypass the SMB service restart
prompt.
lookup
account-name
[account-name]...list
list-domains
.list-domains
Each entry in the output is identified by one of the following tags:
list-sessions
[-p
] [-o
field,...]-o
field,... where fields
are: ID, DOMAIN, ACCT, USER, UID, COMPUTER, IP, OS, LOGON, AGE, NOPEN,
FLAGS. If the -o
option is not specified, the
default field list is: IP,USER,NOPEN,AGE,FLAGSlist-trees
[-p
] [-o
field,...]-o
field,... where fields are: ID, TYPE, NOPEN, NUSER,
TIME, AGE, USER, SHARE. If the -o
option is not
specified, the default field list is: TYPE,SHARE,USER,NOPEN,AGE Note that
this does not list available shares. For that, use:
sharemgr show -v -P smb
list-ofiles
[-p
] [-o
field,...]-o
field,... where fields
are: ID, UNIQID, PERM, NLOCK, PATH, USER. If the
-o
option is not specified, the default field list
is: UNIQID,PATH,USER,NLOCK,PERMclose-session
computer [user]list-sessions
command.
(Usually those columns are the same.) The user
argument is optional, and if specified should be in
user@domain format.close-ofile
file_IDlist-ofiles
output).The smbadm
utility exits 0 on
success, and >0 if an error occurs.
Utility name and options are Uncommitted. Utility output format is Not-An-Interface.
passwd(1), smb(5), smbautohome(5), attributes(7), pam_smb_passwd(7), smf(7), groupadd(8), idmap(8), idmapd(8), kclient(8), share(8), sharectl(8), sharemgr(8), smbd(8), smbstat(8)
June 20, 2023 | OmniOS |