Changing samba password problem

Posted on 2001-06-06
Last Modified: 2010-03-18
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.
Question by:hazza96
  • 6
  • 2
  • 2
LVL 16

Expert Comment

Comment Utility
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...


LVL 17

Expert Comment

Comment Utility
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.
LVL 16

Expert Comment

Comment Utility
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).



Author Comment

Comment Utility
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.

Author Comment

Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

LVL 17

Accepted Solution

psimation earned 300 total points
Comment Utility
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...

Author Comment

Comment Utility
No I didn't do that.

I will try it and tell you what happened.

Author Comment

Comment Utility
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....'

Author Comment

Comment Utility
Didn't fix both parts of my problem but at least root's password is getting stuffed around.

Author Comment

Comment Utility
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.

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Fail2ban says an IP is banned, but not 12 107
Unix / Linux grid computing 5 125
centos7 firewalld udp ports 33 57
Measure data download 2 59
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now