I'm looking for a way to change the password for some user of a Windows box remotely from a Linux Box. Really I have to do it by running some program/system script on the Linux Box but without running anything more than standard services on the windows system.

  • Really it is a programming question, but SO people closed it as not "programming related" so I guess it belongs to ServerFault. I write that to avoid being sent back to SO. – kriss Jun 6 '11 at 22:05
  • So is a windows box or linux box? Your title and body say two different things. – EEAA Jun 6 '11 at 22:08
  • The Question on SO has been edited to be more programming related, but I'm still interrested by means to do that using shell tools on Linux. – kriss Jun 6 '11 at 22:23
  • @Erika: I'm running my script on Linux and the password of a remote Windows box should be changed. – kriss Jun 6 '11 at 22:24

You can update the "unicodePwd" attribute of the user object using LDAP over SSL to reset a user's password. This is probably the most straightforward "cross-platform friendly" way to make such a change because, on the Linux site, you won't need any MSRPC infrastructure.

| improve this answer | |
  • Interesting, but the asker doesn't say whether this machine is joined to a domain or not. – gravyface Jun 7 '11 at 1:12
  • @gravyface: Good point. I'm so used to living in Active Directory environments that I can't imagine not having one. Definitely a good point. – Evan Anderson Jun 7 '11 at 2:42
  • Andersan: I should have said I already did that for machines that are in a domain, I'm looking for another solution for stand alone machines that are not inside a domain. But +1 anyway as I totally agree it's the best solution. – kriss Jun 7 '11 at 8:02

I am somewhat in doubt about what you are going to accomplish - changing a Windows user's password? By script?

If so, take a look into winexe - it uses RPC calls and allows you to run commands on the Windows machine without prior software installation (the Windows firewall must be configured for letting RPC through, tough). Running a net user <username> <password> on the Windows machine would do.

| improve this answer | |
  • Thanks for the link. I was looking for something using the SMB API, but winexe could indeed another way to do it. – kriss Jun 6 '11 at 22:27
  • That would be really a SO question. But you always can take winexe's source code and incorporate it into your project to run a command. In theory, you should be able to use RPC for changing the SAM account information directly - I do not know if Samba's rpcclient would support that. – the-wabbit Jun 6 '11 at 22:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.