Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
you can make a wrapper for both using an "expect passwd" script, or..
let samba do it. look up the "add user script" directive (as well as del user and modify user) for smb.conf, then use the "net user" set of commands (from linux or windows) to add users to the system.
or, use webmin/usermin to mange users, it has optional samba/unix integrated account management built in.
i have a solution for it
type the following script
#vi smbadduser
where smbadduser in not command but it is file name
then wirte some commands in smbadduser file like
echo Type the name of user
read username
useradd $username
passwd $username
echo Type samba user password
smbpasswd -a $username
............
and save it
.........................................
then change the mode of smbadduser file like
#chmod 755 smbadduser
then copy the file into /bin directory
then run the smbadduser command at the command prompt
your output is
[root@biskik2 /]# smbadduser
Type the name of user
sukh
Changing password for user sukh.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
Type samba user password
New SMB password:
Retype new SMB password:
Added user sukh.
[root@biskik2 /]#
Last edited by Sukhwinder Singh; 09-22-2006 at 05:18 AM.
i have a solution for it
type the following at command line
#smbpass -a username
what part of "add linux account AND samba account" was unclear to you in the first post? also smbpasswd -a was already suggested.
I don't mean to dicourage you from trying to help people, but PLEASE read and understand the question, as well as the previous answers, before responding. anythign else is just noise and polution.
what part of "add linux account AND samba account" was unclear to you in the first post? also smbpasswd -a was already suggested.
I don't mean to dicourage you from trying to help people, but PLEASE read and understand the question, as well as the previous answers, before responding. anythign else is just noise and polution.
Thing is when you use tone like that, people who do know the answer think,"Why should I bother" Maybe the guy did not have the mental capacity or knowledge to answer correct but he it trying. As are you. Simple questions like your's, someone like me could also consider "noise and pollution" since the solution is well documented. Just have a bash script that passes all available parameters to useradd and smbpasswd in that order and no user interaction is necessary.The only tricky bit is when you pass the -p parameter to useradd it should be in encrypted format (by the crypt function ) read up on the parameters for useradd and smbpasswd. A good way to get the encrypted password is to add a fake user first, with the desired password, copy the password out of /etc/shadow then delete the fake user. Good luck to you. I realize this is an old post, but I'm answering for the benefit of others still looking for a solution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.