can we execute smbpasswd thro java

I want to enable samba access to the user created. I passed the command string to unix.

String cmd = "/usr/bin/smbpasswd -a " + user + " " + password;

When i executed, i got this error.

When run by root:

smbpasswd [options] [username]

otherwise:

smbpasswd [options]

options:

-Llocal mode (must be first option)

-hprint this usage message

-suse stdin for password prompt

-c smb.conf fileUse the given path to the smb.conf file

-D LEVEL debug level

-r MACHINEremote machine

-U USER remote username

extra options when run by root or in local mode:

-aadd user

-ddisable user

-eenable user

-iinterdomain trust account

-mmachine trust account

-nset no password

-w PASSWORD ldap admin password

-xdelete user

-R ORDER name resolve order

The above error message i got was when i executed using version 3.0. But when i executed the same command using version 2.2 i did not get any error.

[1050 byte] By [Mohamed_Thasneema] at [2007-11-27 11:54:11]
# 1

Are you sure this isn't a Samba question? Does this work from the command line?

CeciNEstPasUnProgrammeura at 2007-7-29 18:54:30 > top of Java-index,Java Essentials,Java Programming...
# 2

Does the version has got any thing to do with the command. In both the versions 2.2 and 3.0, -a is the option to add the user.

Mohamed_Thasneema at 2007-7-29 18:54:30 > top of Java-index,Java Essentials,Java Programming...
# 3

> Does the version has got any thing to do with the

> command. In both the versions 2.2 and 3.0, -a is the

> option to add the user.

Maybe the arguments have changed. I don't know, I don't use Samba. I asked: "does this work from the command line"?

CeciNEstPasUnProgrammeura at 2007-7-29 18:54:30 > top of Java-index,Java Essentials,Java Programming...
# 4

So ummm you are running your java program as root?

cotton.ma at 2007-7-29 18:54:30 > top of Java-index,Java Essentials,Java Programming...