Multipla User add in SAMBA
3 Attachment(s)
Hi,
I have installed RHEL 6.3. I have created around 200 users and their home directories through "newuser" command. I wanted the same directories should be available on windows so I have configured SAMBA on RHEL. Now the problem is adding 200 users through"smbpasswd" command one-by-one. I was looking here for a suitable script for the same and found one at http://www.linuxquestions.org/questi...-users-309812/. I copied the script by "homely" at the end of the above link. I tried to modify it as new RHEL users are not required as it is already created so I modified it(attached with this) but whatever I am doing it is giving different errors. I am adding all screen shots and final file. It is beyond of my control - please help. I have to add the users with passwords into samba. |
Quote:
The errors are very clear: you have left the ^M's in it (from where you copied the script from another thread), which is causing some of your problems. Remove them, either with sed, or by re-typing the script manually. After that, any other problems can be dealt with one at a time...and you can reference any of the VERY easily-found shell scripting tutorials to help put this 'in your control'. |
the ultimate scripts for adding users and changing passwords
3 Attachment(s)
hi folks,
long ago i made a script for adding mass of users and one for changing passwords. The first (smbaddnewusers) creates users in BSD or linux (also CentOS with SeLinux security) and for samba, also creates the specified home directory and adjust SeLinux attributes, the second one (smbchangepwd) changes the passwords for specified users (also for samba). Place all files in /root/data/scripts/ and chmod this directory to 700 You can change the user directories according your environment in scripts. Until now i used these scripts for creating Thousands of users or changing passwords, both in OpenBSD and Linux. First you need to create a text file with all parameters and place it in /root/data/scripts/conf.newusers.cfg (chmod 700). You can do this in linux with LibreOffice (or OpenOffice) Calc (see examples in attachment) sample config file for smbaddnewusers Code:
# /root/data/scripts/conf.newusers.cfg Code:
# /root/data/scripts/conf.changepwd.cfg smbaddnewusers - bash script, so bash has to be installed! smbchangepwd - bash script, so bash has to be installed! conf.sample.cfg (1) - sample config file for creating users including their home directory conf.sample.cfg (2) - sample config for changing unix and samba passwords # i can't upload following files, if you are interested, send me your email adress. conf.newusers.ods - conf.newusers.cfg as LibrOffice file conf.changepwd.ods - conf.changepwd.cfg as LibrOffice file |
All times are GMT -5. The time now is 10:23 PM. |