1 2 3 4 5 6 7<html><head><title>smbpasswd (8)</title> 8 9<link rev="made" href="mailto:samba@samba.org"> 10</head> 11<body> 12 13<hr> 14 15<h1>smbpasswd (8)</h1> 16<h2>Samba</h2> 17<h2>23 Oct 1998</h2> 18 19 20 21<p><a name="NAME"></a> 22<h2>NAME</h2> 23 smbpasswd - change a users SMB password 24<p><a name="SYNOPSIS"></a> 25<h2>SYNOPSIS</h2> 26 27<p><strong>smbpasswd</strong> [<a href="smbpasswd.8.html#minusa">-a</a>] [<a href="smbpasswd.8.html#minusx">-x</a>] [<a href="smbpasswd.8.html#minusd">-d</a>] [<a href="smbpasswd.8.html#minuse">-e</a>] [<a href="smbpasswd.8.html#minusD">-D debug level</a>] [<a href="smbpasswd.8.html#minusn">-n</a>] [<a href="smbpasswd.8.html#minusr">-r remote_machine</a>] [<a href="smbpasswd.8.html#minusR">-R name resolve order</a>] [<a href="smbpasswd.8.html#minusm">-m</a>] [<a href="smbpasswd.8.html#minusj">-j DOMAIN</a>] [<a href="smbpasswd.8.html#minusU">-U username</a>] [<a href="smbpasswd.8.html#minush">-h</a>] [<a href="smbpasswd.8.html#minuss">-s</a>] <a href="smbpasswd.8.html#username">username</a> 28<p><a name="DESCRIPTION"></a> 29<h2>DESCRIPTION</h2> 30 31<p>This program is part of the <strong>Samba</strong> suite. 32<p>The <strong>smbpasswd</strong> program has several different functions, depending 33on whether it is run by the <em>root</em> user or not. When run as a normal 34user it allows the user to change the password used for their SMB 35sessions on any machines that store SMB passwords. 36<p>By default (when run with no arguments) it will attempt to change the 37current users SMB password on the local machine. This is similar to 38the way the <strong>passwd (1)</strong> program works. <strong>smbpasswd</strong> differs from how 39the <strong>passwd</strong> program works however in that it is not <em>setuid root</em> 40but works in a client-server mode and communicates with a locally 41running <a href="smbd.8.html"><strong>smbd</strong></a>. As a consequence in order for this 42to succeed the <a href="smbd.8.html"><strong>smbd</strong></a> daemon must be running on 43the local machine. On a UNIX machine the encrypted SMB passwords are 44usually stored in the <a href="smbpasswd.5.html"><strong>smbpasswd (5)</strong></a> file. 45<p>When run by an ordinary user with no options. <strong>smbpasswd</strong> will 46prompt them for their old smb password and then ask them for their new 47password twice, to ensure that the new password was typed 48correctly. No passwords will be echoed on the screen whilst being 49typed. If you have a blank smb password (specified by the string "NO 50PASSWORD" in the <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file) then just 51press the <Enter> key when asked for your old password. 52<p><strong>smbpasswd</strong> can also be used by a normal user to change their SMB 53password on remote machines, such as Windows NT Primary Domain 54Controllers. See the <a href="smbpasswd.8.html#minusr">(<strong>-r</strong>)</a> and 55<a href="smbpasswd.8.html#minusU"><strong>-U</strong></a> options below. 56<p>When run by root, <strong>smbpasswd</strong> allows new users to be added and 57deleted in the <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file, as well as 58allows changes to the attributes of the user in this file to be made. When 59run by root, <strong>smbpasswd</strong> accesses the local 60<a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file directly, thus enabling 61changes to be made even if <a href="smbd.8.html"><strong>smbd</strong></a> is not running. 62<p><a name="OPTIONS"></a> 63<h2>OPTIONS</h2> 64 65<p><dl> 66<p><a name="minusa"></a> 67<p></p><dt><strong><strong>-a</strong></strong><dd> This option specifies that the username following should 68be added to the local <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file, with 69the new password typed (type <Enter> for the old password). This 70option is ignored if the username following already exists in the 71<a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file and it is treated like a 72regular change password command. Note that the user to be added 73<strong>must</strong> already exist in the system password file (usually /etc/passwd) 74else the request to add the user will fail. 75<p>This option is only available when running <strong>smbpasswd</strong> as 76root. 77<p><a name="minusx"></a> 78<p></p><dt><strong><strong>-x</strong></strong><dd> This option specifies that the username following should 79be deleted from the local <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file. 80<p>This option is only available when running <strong>smbpasswd</strong> as 81root. 82<p><a name="minusd"></a> 83<p></p><dt><strong><strong>-d</strong></strong><dd> This option specifies that the username following should be 84<em>disabled</em> in the local <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file. 85This is done by writing a <em>'D'</em> flag into the account control space 86in the <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file. Once this is done 87all attempts to authenticate via SMB using this username will fail. 88<p>If the <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file is in the 'old' 89format (pre-Samba 2.0 format) there is no space in the users password 90entry to write this information and so the user is disabled by writing 91'X' characters into the password space in the 92<a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file. See <a href="smbpasswd.5.html"><strong>smbpasswd 93(5)</strong></a> for details on the 'old' and new password file 94formats. 95<p>This option is only available when running <strong>smbpasswd</strong> as root. 96<p><a name="minuse"></a> 97<p></p><dt><strong><strong>-e</strong></strong><dd> This option specifies that the username following should be 98<em>enabled</em> in the local <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file, 99if the account was previously disabled. If the account was not 100disabled this option has no effect. Once the account is enabled 101then the user will be able to authenticate via SMB once again. 102<p>If the smbpasswd file is in the 'old' format then <strong>smbpasswd</strong> will 103prompt for a new password for this user, otherwise the account will be 104enabled by removing the <em>'D'</em> flag from account control space in the 105<a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file. See <a href="smbpasswd.5.html"><strong>smbpasswd 106(5)</strong></a> for details on the 'old' and new password file 107formats. 108<p>This option is only available when running <strong>smbpasswd</strong> as root. 109<p><a name="minusD"></a> 110<p></p><dt><strong><strong>-D debuglevel</strong></strong><dd> debuglevel is an integer from 0 111to 10. The default value if this parameter is not specified is zero. 112<p>The higher this value, the more detail will be logged to the log files 113about the activities of smbpasswd. At level 0, only critical errors 114and serious warnings will be logged. 115<p>Levels above 1 will generate considerable amounts of log data, and 116should only be used when investigating a problem. Levels above 3 are 117designed for use only by developers and generate HUGE amounts of log 118data, most of which is extremely cryptic. 119<p><a name="minusn"></a> 120<p></p><dt><strong><strong>-n</strong></strong><dd> This option specifies that the username following should 121have their password set to null (i.e. a blank password) in the local 122<a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file. This is done by writing the 123string "NO PASSWORD" as the first part of the first password stored in 124the <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file. 125<p>Note that to allow users to logon to a Samba server once the password 126has been set to "NO PASSWORD" in the 127<a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file the administrator must set 128the following parameter in the [global] section of the 129<a href="smb.conf.5.html"><strong>smb.conf</strong></a> file : 130<p><a href="smb.conf.5.html#nullpasswords">null passwords = true</a> 131<p>This option is only available when running <strong>smbpasswd</strong> as root. 132<p><a name="minusr"></a> 133<p></p><dt><strong><strong>-r remote machine name</strong></strong><dd> This option allows a 134user to specify what machine they wish to change their password 135on. Without this parameter <strong>smbpasswd</strong> defaults to the local 136host. The <em>"remote machine name"</em> is the NetBIOS name of the 137SMB/CIFS server to contact to attempt the password change. This name 138is resolved into an IP address using the standard name resolution 139mechanism in all programs of the <a href="samba.7.html"><strong>Samba</strong></a> 140suite. See the <a href="smbpasswd.8.html#minusR"><strong>-R name resolve order</strong></a> parameter for details on changing this resolving 141mechanism. 142<p>The username whose password is changed is that of the current UNIX 143logged on user. See the <a href="smbpasswd.8.html#minusU"><strong>-U username</strong></a> 144parameter for details on changing the password for a different 145username. 146<p>Note that if changing a Windows NT Domain password the remote machine 147specified must be the Primary Domain Controller for the domain (Backup 148Domain Controllers only have a read-only copy of the user account 149database and will not allow the password change). 150<p><em>Note</em> that Windows 95/98 do not have a real password database 151so it is not possible to change passwords specifying a Win95/98 152machine as remote machine target. 153<p><a name="minusR"></a> 154<p></p><dt><strong><strong>-R name resolve order</strong></strong><dd> This option allows the user of 155smbclient to determine what name resolution services to use when 156looking up the NetBIOS name of the host being connected to. 157<p>The options are :<a href="smbpasswd.8.html#lmhosts">"lmhosts"</a>, <a href="smbpasswd.8.html#host">"host"</a>, 158<a href="smbpasswd.8.html#wins">"wins"</a> and <a href="smbpasswd.8.html#bcast">"bcast"</a>. They cause names to be 159resolved as follows : 160<p><dl> 161<p><a name="lmhosts"></a> 162<li > <strong>lmhosts</strong> : Lookup an IP address in the Samba lmhosts file. 163<p><a name="host"></a> 164<li > <strong>host</strong> : Do a standard host name to IP address resolution, 165using the system /etc/hosts, NIS, or DNS lookups. This method of name 166resolution is operating system dependent. For instance on IRIX or 167Solaris, this may be controlled by the <em>/etc/nsswitch.conf</em> file). 168<p><a name="wins"></a> 169<li > <strong>wins</strong> : Query a name with the IP address listed in the 170<a href="smb.conf.5.html#winsserver"><strong>wins server</strong></a> parameter in the 171<a href="smb.conf.5.html"><strong>smb.conf file</strong></a>. If 172no WINS server has been specified this method will be ignored. 173<p><a name="bcast"></a> 174<li > <strong>bcast</strong> : Do a broadcast on each of the known local interfaces 175listed in the <a href="smb.conf.5.html#interfaces"><strong>interfaces</strong></a> parameter 176in the smb.conf file. This is the least reliable of the name resolution 177methods as it depends on the target host being on a locally connected 178subnet. 179<p></dl> 180<p>If this parameter is not set then the name resolve order defined 181in the <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file parameter 182<a href="smb.conf.5.html#nameresolveorder"><strong>name resolve order</strong></a> 183will be used. 184<p>The default order is lmhosts, host, wins, bcast and without this 185parameter or any entry in the <a href="smb.conf.5.html"><strong>smb.conf</strong></a> 186file the name resolution methods will be attempted in this order. 187<p><a name="minusm"></a> 188<p></p><dt><strong><strong>-m</strong></strong><dd> This option tells <strong>smbpasswd</strong> that the account being 189changed is a <em>MACHINE</em> account. Currently this is used when Samba is 190being used as an NT Primary Domain Controller. PDC support is not a 191supported feature in Samba2.0 but will become supported in a later 192release. If you wish to know more about using Samba as an NT PDC then 193please subscribe to the mailing list 194<a href="mailto:samba-ntdom@samba.org"><em>samba-ntdom@samba.org</em></a>. 195<p>This option is only available when running <strong>smbpasswd</strong> as root. 196<p><a name="minusj"></a> 197<p></p><dt><strong><strong>-j DOMAIN</strong></strong><dd> This option is used to add a Samba server into a 198Windows NT Domain, as a Domain member capable of authenticating user 199accounts to any Domain Controller in the same way as a Windows NT 200Server. See the <a href="smb.conf.5.html#security"><strong>security=domain</strong></a> 201option in the <a href="smb.conf.5.html"><strong>smb.conf (5)</strong></a> man page. 202<p>In order to be used in this way, the Administrator for the Windows 203NT Domain must have used the program <em>"Server Manager for Domains"</em> 204to add the <a href="smb.conf.5.html#netbiosname">primary NetBIOS name</a> of 205the Samba server as a member of the Domain. 206<p>After this has been done, to join the Domain invoke <strong>smbpasswd</strong> with 207this parameter. <strong>smbpasswd</strong> will then look up the Primary Domain 208Controller for the Domain (found in the 209<a href="smb.conf.5.html"><strong>smb.conf</strong></a> file in the parameter 210<a href="smb.conf.5.html#passwordserver"><strong>password server</strong></a> and change 211the machine account password used to create the secure Domain 212communication. This password is then stored by <strong>smbpasswd</strong> in a 213file, read only by root, called <code><Domain>.<Machine>.mac</code> where 214<code><Domain></code> is the name of the Domain we are joining and <code><Machine></code> 215is the primary NetBIOS name of the machine we are running on. 216<p>Once this operation has been performed the 217<a href="smb.conf.5.html"><strong>smb.conf</strong></a> file may be updated to set the 218<a href="smb.conf.5.html#security"><strong>security=domain</strong></a> option and all 219future logins to the Samba server will be authenticated to the Windows 220NT PDC. 221<p>Note that even though the authentication is being done to the PDC all 222users accessing the Samba server must still have a valid UNIX account 223on that machine. 224<p>This option is only available when running <strong>smbpasswd</strong> as root. 225<p><a name="minusU"></a> 226<p></p><dt><strong><strong>-U username</strong></strong><dd> This option may only be used in 227conjunction with the <a href="smbpasswd.8.html#minusr"><strong>-r</strong></a> 228option. When changing a password on a remote machine it allows the 229user to specify the user name on that machine whose password will be 230changed. It is present to allow users who have different user names on 231different systems to change these passwords. 232<p><a name="minush"></a> 233<p></p><dt><strong><strong>-h</strong></strong><dd> This option prints the help string for <strong>smbpasswd</strong>, 234selecting the correct one for running as root or as an ordinary user. 235<p><a name="minuss"></a> 236<p></p><dt><strong><strong>-s</strong></strong><dd> This option causes <strong>smbpasswd</strong> to be silent (i.e. not 237issue prompts) and to read it's old and new passwords from standard 238input, rather than from <code>/dev/tty</code> (like the <strong>passwd (1)</strong> program 239does). This option is to aid people writing scripts to drive <strong>smbpasswd</strong> 240<p><a name="username"></a> 241<p></p><dt><strong><strong>username</strong></strong><dd> This specifies the username for all of the <em>root 242only</em> options to operate on. Only root can specify this parameter as 243only root has the permission needed to modify attributes directly 244in the local <a href="smbpasswd.5.html"><strong>smbpasswd</strong></a> file. 245<p><a name="NOTES"></a> 246<h2>NOTES</h2> 247 248<p>Since <strong>smbpasswd</strong> works in client-server mode communicating with a 249local <a href="smbd.8.html"><strong>smbd</strong></a> for a non-root user then the <strong>smbd</strong> 250daemon must be running for this to work. A common problem is to add a 251restriction to the hosts that may access the <strong>smbd</strong> running on the 252local machine by specifying a <a href="smb.conf.5.html#allowhosts"><strong>"allow 253hosts"</strong></a> or <a href="smb.conf.5.html#denyhosts"><strong>"deny 254hosts"</strong></a> entry in the 255<a href="smb.conf.5.html"><strong>smb.conf</strong></a> file and neglecting to allow 256<em>"localhost"</em> access to the <strong>smbd</strong>. 257<p>In addition, the <strong>smbpasswd</strong> command is only useful if <strong>Samba</strong> has 258been set up to use encrypted passwords. See the file <strong>ENCRYPTION.txt</strong> 259in the docs directory for details on how to do this. 260<p><a name="VERSION"></a> 261<h2>VERSION</h2> 262 263<p>This man page is correct for version 2.0 of the Samba suite. 264<p><a name="AUTHOR"></a> 265<h2>AUTHOR</h2> 266 267<p>The original Samba software and related utilities were created by 268Andrew Tridgell <a href="mailto:samba@samba.org"><em>samba@samba.org</em></a>. Samba is now developed 269by the Samba Team as an Open Source project similar to the way the 270Linux kernel is developed. 271<p>The original Samba man pages were written by Karl Auer. The man page 272sources were converted to YODL format (another excellent piece of Open 273Source software, available at 274<a href="ftp://ftp.icce.rug.nl/pub/unix/"><strong>ftp://ftp.icce.rug.nl/pub/unix/</strong></a>) 275and updated for the Samba2.0 release by Jeremy Allison. 276<a href="mailto:samba@samba.org"><em>samba@samba.org</em></a>. 277<p>See <a href="samba.7.html"><strong>samba (7)</strong></a> to find out how to get a full 278list of contributors and details on how to submit bug reports, 279comments etc. 280</body> 281</html> 282