Go Premium for a chance to win a PS4. Enter to Win


Changing samba password problem

Posted on 2001-06-06
Medium Priority
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

ID: 6163203
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

ID: 6164653
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 www.linuxhelp.co.za 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

ID: 6165495
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).


What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 6165890
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

ID: 6165905
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
LVL 17

Accepted Solution

psimation earned 900 total points
ID: 6166678
Tell me, when you setup samba the first time, did you ever run the command
cat /etc/passwd | mksmbpasswd.sh > /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

ID: 6179927
No I didn't do that.

I will try it and tell you what happened.

Author Comment

ID: 6193685
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

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

Author Comment

ID: 6268328
Hey I found the actual answer. psimation was close the actual command I needed to run was

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

The 'sh' before the mksmbpasswd.sh was missing, everything works great now.

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

926 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