Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 431
  • Last Modified:

Changing samba password problem

I have Mandrake 7.2 with samba 2.0.7 installed.

My WinME workstation can login to the samba box and run the logon.bat. It maps drives and sync's the time to the linux/samba box.

My problem is that I can't change the samba password from the Windows machine.

I go into 'Control Panel / Passwords', click on the 'Change Windows Password' button, tick the box next to 'Microsoft Networking' then enter the old password and the new password twice.

It thens comes back and says 'The password you typed is not correct for Microsoft Networking, blah blah..'

When I telnet into the linux box it wouldn't accept the root password when I tried to 'su' but did accept the password I tried to change my samba user name to.

So it went like this:

root with password of root01
user1 with password of pass01

I tried to change my samba user password to newone01

root with password of newone01
user1 with password of pass01

How would a samba user trying to change their password change root's password? The user is an ordinary pleb user with no super user privlidges.
  • 6
  • 2
  • 2
1 Solution
In a DOS window, type:

net password \\servername

where servername is the netbios name of the server which you wish to change your password.

If you are not using smbpasswd, let me know and I'll find more stuff for you to try...


You probably logged on to the samba network as user root, that's why it changed the password for root.
However, the best way to do this is to change the passwords on the linux box with the smbpasswd user command.
You can take a look at my website at and follow the networking link. It will show you how to configure samba to use encrypted passwords to allow win9x/2000 boxes to logion plus how to change the passwords etc.
Also, plz post your /etc/samba/smb.conf file here.
Oops - didn't notice the username mixup.

Try this (in a DOS window)

net password \\servername username

where servername is the netbios name of your samba server and username is the name of the user whose samba password you are trying to change

I agree with psimation about your appearing to be logged in as root - however, the above command should work for you, regardless (although it would probably be worth your while to figure out why windows thinks you are root rather than user1).


Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

hazza96Author Commented:
I am logged into the windows network as user1.

Those answers are good for me, I can even telnet in and run the smbpasswd command.

The problem is I am trying to set this up for the office and the users hardly know what the on/off button does let alone get to a DOS window.

Besides that those answers are work arounds not fixs. It SHOULDN'T change roots password, however it does, why and how to I get it to stop doing it.

Eventually someone on the network is going to try and use the control panel to change their password and I am going to lose the root password. That is not a good situation.
hazza96Author Commented:
Here's the Global and Netlogon sections of my smb.conf

    workgroup = 4ward
    guest account = nobody
    keep alive = 30
    os level = 2
    security = user
    printing = bsd
    printcap name = /etc/printcap
    load printers = yes
    passwd program = /usr/bin/passwd
    interfaces =
    wins support = yes
    domain master = yes
    preferred master = yes
    domain logons = yes
    logon path = \\felix\%U\profiles
    logon script = logon.bat
    logon drive = h:
    logon home = "\\felix\%U"
    encrypt passwords = yes
    unix password sync = yes
    server string = Samba Server
    map to guest = never
    password level = 0
    null passwords = no
    name resolve order = lmhosts, host, wins, bcast
    dead time = 0
    debug level = 0

    comment = Logon script
    path = /home/system/samba/netlogon
    guest ok = no
    read only = yes
    locking = no
    available = yes
Tell me, when you setup samba the first time, did you ever run the command
cat /etc/passwd | > /etc/samba/smbpasswd ?
I think what's happening here is that instead of using samba's passwd file, you are using the system's passwd file, which is why you are getting these root password messups...
hazza96Author Commented:
No I didn't do that.

I will try it and tell you what happened.
hazza96Author Commented:
Well theres goods news and bad news.

The good news is that when the user tries to change thier password it doesn't stuff root's password.

The bad news is that they still can't change thier own. It still says 'The password you typed is not correct for Microsoft Networking....'
hazza96Author Commented:
Didn't fix both parts of my problem but at least root's password is getting stuffed around.
hazza96Author Commented:
Hey I found the actual answer. psimation was close the actual command I needed to run was

cat /etc/passwd |sh > /etc/samba/smbpasswd

The 'sh' before the was missing, everything works great now.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 6
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now