The
smbpasswd program has several different functions, depending on
whether it is run by the root user or not. When run as a normal user
it allows the user to change the password used for their SMB sessions
on any machines that store SMB passwords.
By
default (when run with no arguments) it will attempt to change the
current user´s SMB password on the local machine. This is similar to
the way the passwd program works. smbpasswd differs from how the
passwd program works however in that it is not setuid root but works
in a client-server mode and communicates with a locally running smbd.
As a consequence in order for this to succeed the smbd daemon must be
running on the local machine. On a UNIX machine the encrypted SMB
passwords are usually stored in the smbpasswd file.
When
run by an ordinary user with no options, smbpasswd will prompt them
for their old SMB password and then ask them for their new password
twice, to ensure that the new password was typed correctly. No
passwords will be echoed {seen} on the screen whilst being typed. If
you have a blank SMB password (specified by the string "NO
PASSWORD" in the smbpasswd file) then just press the <Enter>
key when asked for your old passwd.
smbpasswd
can also be used by a normal user to change their SMB password on
remote machines, such as Windows NT Primary Domain Controllers.
When
run by root, smbpasswd allows new users to be added and deleted in
the smbpasswd file, as well as allows changes to the attributes of
the user in this file to be made. When run by root, smbpasswd
accesses the local smbpasswd file directly, thus enabling changes to
be made even if smbd is not running.
Smbpasswd
Options
No. | Options | Description |
1. | -a | This
option specifies that the username should be added to the local smbpasswd file, with the new password typed (type <Enter> for the old password). |
2. | -x | This
option specifies that the username should be deleted from the local smbpasswd file. |
3. | -d | This
option specifies that the username should be disabled in the local smbpasswd file. |
4. | -e | This
option specifies that the username should be enabled in the local smbpasswd file, if the account was previously disabled. If the account was not disabled this option has no effect. |
5. | -n | This
option specifies that the username should have their password set to null (i.e. a blank password) in the local smbpasswd file. |
6. | -L | This
specifies the username for all of the root only options to
operate on. Only root can specify this parameter as only root has the permission needed to modify attributes directly in the local smbpasswd file. |
Some
examples
Deepti
now needs to be allocated a password for accessing the Samba server.
Remember, this is a separate password to her UNIX account any may be
different if necessary.
[root@lan
~]# smbpasswd -a deepti
New
SMB password:
Retype
new SMB password:
Added
user deepti.
[root@lan
~]#
The
above command adds (-a) an entry into the "smb password file"
and encrypts the password. Type "smbpasswd deepti" to
simply change passwords.
deepti
can now access the server over the network, however there are still
no shares defined.
[root@lan
~]# grep deepti /etc/samba/smbpasswd
deepti:501:96E0D1709FC223FAAAD3B435B51404EE:D27916F620BA786CE3EF222565D6F691:[U
]:LCT-4F4E7754:
[root@lan
~]#
###################################################
0 comments:
Post a Comment
Note: only a member of this blog may post a comment.