LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   remotely new user add with password in samba server (https://www.linuxquestions.org/questions/linux-enterprise-47/remotely-new-user-add-with-password-in-samba-server-609754/)

anindyabhattacharjee 12-29-2007 12:58 AM

remotely new user add with password in samba server
 
Dear All,

I am using ldap and samba on rhel 4 update 4. I am configuring samba with ldap users and password. Everything is working fine. Now I want to write a script which will add new user and password on samba server. I will run this script from another machine. all ldap users are available in samba server as I am using ldap authentication through authconfig. I have read man page of smbpasswd and tried as follows --

new username -- kkk
password for kkk --- abcdef
samba server -- 192.168.1.78

I tried the following command ---

smbpasswd -r 192.168.1.78 -U kkk changeme

but it did not work . as per man page -s option can be used for this purpose. But when I am giving --

smbpasswd -r 192.168.1.78 -U kkk -s changeme


it did not execute.

If I can give new username and password in a single command ( it will not ask for New smb passowrd) like ---

smbpasswd -a kkk changeme

it can also solve my problem. I will configure ssh with key and then execute that command on samba server.

I have to run this script from another server which will add user and password on samba server.


Thanks in advance............
Regards
anindya bhattacharjee

Dinithion 12-30-2007 06:38 PM

According to the man-pages of smbpasswd you are supposed to use netbios name with the -r option. I don't have a ldap-server anymore, so I can't test if it is possible to use both netbios or IP. Anyway, it's worth a shot.

Anyway, you could try out the smbldap-tools package. Those programs can be used to add/remove/modify your userdatabase on your ldap server from the commandline.

anindyabhattacharjee 01-01-2008 03:48 AM

Dear Dinithion,

thanks for your reply. I have solved the problem for time being.
later I will look into smb-ldap.

Thanks once again.

Regards
anindya


All times are GMT -5. The time now is 02:57 AM.