Hi all, Quick question, is it possible to take an existing /etc/passwd file and run it through mksmbpasswd.sh (or some other script) to update a smbpasswd file? I am asking this because everytime we change a password or add or delete usernames on a machine, it would seem we have to do the same thing to change th samba password file, and I'm hopeing there is an easier way..... thanks, jeff pajor@descent.net
Jeff, It isn't possible to convert the encrypted passwords in the /etc/passwd file to the passwords in the smbpasswd file, so a direct conversion is not possible. -- Bill Knox Senior Operating Systems Programmer/Analyst The MITRE Corporation Jeff Pajor wrote:> > Hi all, > > Quick question, is it possible to take an existing /etc/passwd file and > run it through mksmbpasswd.sh (or some other script) to update a smbpasswd > file? I am asking this because everytime we change a password or add or > delete usernames on a machine, it would seem we have to do the same thing > to change th samba password file, and I'm hopeing there is an easier > way..... > > thanks, > > jeff > pajor@descent.net
Jeff, I am using RedHat 6.1 and Samba 2.0.6 and I wrote a script file that works for me. But I don't think it will work if you are using an older version of Samba, Also I don't think it will work if you are not using the BASH Shell. This script does more than just add usernames and passwords but you should be able to modify it to suit your needs. Here it is: #!/bin/sh # # Get New User Name # while true ; do clear echo -n 'Please Enter New User Name: ' read v_user break done # # Get Password while true ; do echo -n 'Please Enter Password: ' read v_passwd break done # # Get Group Name while true ; do echo -n 'Please type Group Name: ' read v_group break done # # Add Linux Group and Group Folder groupadd $v_group mkdir /home/$v_group chgrp $v_group /home/$v_group chmod 770 /home/$v_group # # Add Linux Account adduser $v_user -g $v_group -p $v_passwd -n # # Add Samba Account and set Password smbpasswd -a $v_user -s $v_passwd # # Make User Data Directory mkdir /home/$v_user/data # # Set Permissions on User Directory chmod -R 700 /home/$v_user chown -R $v_user /home/$v_user chgrp -R $v_group /home/$v_user Hope This helps. Keith Muska Clements Manufacturing, L.L.C. Phone: (810) 376-2215 Ext. 170 Fax: (253) 681-7311 [ Linux is very Friendly ... ... just pickier about who it makes friends with. ]